On 11/1/07, glyph at divmod.com <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? Yes, if you remember my initial post, it contained this line: assert isinstance(prop, property) And even without that, accessing prop.fget would fail immediately; so instead of a non-functioning property, you get an exception at class definition time. -- --Guido van Rossum (home page: http://www.python.org/~guido/)
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