[issue1416] @prop.setter decorators

2007-11-10 Thread Guido van Rossum
Guido van Rossum added the comment: Checked into trunk as revision 58929. -- resolution: -> accepted status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ _

[issue1416] @prop.setter decorators

2007-11-10 Thread Christian Heimes
Christian Heimes added the comment: Fixed a typo: +PyDoc_STRVAR(getter_doc, +"Descriptor to change the setter on a property."); ^^^ -- nosy: +tiran Added file: http://bugs.python.org/file8729/propset4.diff __

[issue1416] @prop.setter decorators

2007-11-10 Thread Guido van Rossum
Guido van Rossum added the comment: propset3.diff removes the hack that makes the deleter equal to the setter when no separate deleter has been specified. If you want a single method to be used as setter and deleter, write this: @foo.setter @foo.deleter def foo(self, value=None): ... Added fil

[issue1416] @prop.setter decorators

2007-11-10 Thread Guido van Rossum
Guido van Rossum added the comment: propset2.diff is a new version that improves upon the heuristic for making the deleter match the setter: when changing setters, if the old deleter is the same as the old setter, it will replace both the deleter and setter. This diff is relative to the 2.6 trun

[issue1416] @prop.setter decorators

2007-11-10 Thread Paul Pogonyshev
Paul Pogonyshev added the comment: Looks great (regardless of how this is implemented). I always hated this def get_foo / def set_foo / foo = property (get_foo, set_foo). -- nosy: +_doublep __ Tracker <[EMAIL PROTECTED]>

[issue1416] @prop.setter decorators

2007-11-09 Thread Guido van Rossum
New submission from Guido van Rossum: Here's an implementation of the idea I floated recently on python-dev (Subject: Declaring setters with getters). This implements the kind of syntax that I believe won over most folks in the end: @property def foo(self): ... @foo.setter def foo(self