On Wed, Mar 10, 2004, Guido van Rossum wrote: >Aahz: >>Someone: >>> >>> I'd be very surprised if the interpreter cared that a decorator >>> returned a callable; what should it care? >> >> The interpreter doesn't care; *people* care. That's precisely why it >> should be a documented requirement. > > So decorators couldn't be used to create read-only properties? Maybe I'm misunderstanding something. I thought that a property contains a get descriptor, which makes it a kind of callable. Read-only properties contain a set descriptor that either does nothing or raises an exception. That doesn't affect whether the property is classified as a callable. Also, I thought we had explicitly punted on allowing decorators to create properties because the syntax wasn't sufficiently flexible without contortions. -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Do not taunt happy fun for loops. Do not change lists you are looping over." --Remco Gerlich, comp.lang.python
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