On 11/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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/) _______________________________________________ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
