On Nov 1, 2007, at 10:26 AM, glyph at divmod.com wrote: > This is a minor nit, as with all decorators that take an argument, > it seems like it sets up a hard-to-debug error condition if you were > to accidentally forget it: > > @property > def foo(): ... > @property.set > def foo(): ... > > would leave you with 'foo' pointing at something that wasn't a > descriptor at all. Is there a way to make that more debuggable? How about this: give the property instance a method that changes a property from read-only to read-write. No parens, no frame magic. As a small bonus, the setter function would not have to be named the same as the property. class A(object): @property def foo(self): return 1 @foo.setter def set_foo(self, value): print 'set:', value -Tony
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