On 10/16/05, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 10/16/05, Nick Coghlan <[EMAIL PROTECTED]> wrote: > > On and off, I've been looking for an elegant way to handle properties using > > decorators. > > > > It hasn't really worked, because decorators are inherently single function, > > and properties span multiple functions. > > > > However, it occurred to me that Python already contains a construct for > > grouping multiple related functions together: classes. > > Nick, and everybody else trying to find a "solution" for this > "problem", please don't. There's nothing wrong with having the three > accessor methods explicitly in the namespace, it's clear, and probably > less typing (and certainly less indenting!). Just write this: > > class C: > def getFoo(self): ... > def setFoo(self): ... > foo = property(getFoo, setFoo)
Does this necessisarily mean a 'no' still for class decorators, or do you just not like this particular use case for them. Or, are you perhaps against this proposal due to its use of nested classes? _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com