Duncan Booth wrote: > How about this: > > class A(object): > > def foo(self, foo) [property.set]: > "Setter for property 'foo'." > self.__foo = foo > > def foo(self) [property.get]: > "Getter for property 'foo'." > return self.__foo This is beautiful, but it does not work: when defining the getter, you need both the old property, and the new function object. Looking at your code def set(fn): if isinstance(fn, property): return property(fn.fget, fn, fn.fdel, fn.__doc__) you first assume fn is the property object, and then assume it is the setter function. Of course, there is no reason why the namespace-under-construction couldn't be passed to the annotation, but that would be an extension to the protocol. Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4