Re: need help with properties

2009-05-09 Thread Esmail
Scott David Daniels wrote: <... good stuff ... > the Python 3.X world is wisely losing the unpacking in parameter passing trick. Thanks Scott, useful information, Esmail -- http://mail.python.org/mailman/listinfo/python-list

Re: need help with properties

2009-05-09 Thread Scott David Daniels
Esmail wrote: Just curious, is there a way to pass more than one arg to a setter, or do we always have use some sort of unpacking at the other end? Think about the source for a setter. it comes from: .name = You could add optional args, but the option would never be taken. If you never in

Re: need help with properties

2009-05-09 Thread Esmail
Steven D'Aprano wrote: All you've done in this second block is define a new object called "size" and assign the tuple (3, 7) to it. oops .. yes, you are right, and I am embarrassed... [Aside: you might not be aware that it is commas that make tuples, not brackets. The brackets are for grou

Re: need help with properties

2009-05-09 Thread Esmail
hi Scott, Scott David Daniels wrote: Esmail wrote: I am just reading about properties in Python. I am thinking of this as an indirection mechanism, is that wrong? If so, how come the getter/setters aren't called when I use properties instead of the functions directly? Because you weren't actua

Re: need help with properties

2009-05-09 Thread Steven D'Aprano
On Sat, 09 May 2009 11:30:02 -0400, Esmail wrote: > Hi, > > I am just reading about properties in Python. I am thinking of this as > an indirection mechanism, is that wrong? If so, how come the > getter/setters aren't called when I use properties instead of the > functions directly? > > What am

Re: need help with properties

2009-05-09 Thread Scott David Daniels
Esmail wrote: I am just reading about properties in Python. I am thinking of this as an indirection mechanism, is that wrong? If so, how come the getter/setters aren't called when I use properties instead of the functions directly? Because you weren't actually using them. You were writing: