On Wed, Mar 10, 2004 at 07:04:38AM -0800, Guido van Rossum wrote: > > > 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? Perhaps the default behavior should be more similar to C# attributes which are simply associated with the object for introspection. Only if the decorator has a method with some __special__ name that method would be called and the object replaced by its return value. Builtins like staticmethod or classmethod don't HAVE to remain functions as long as they remain backward compatible. After all, functions like int and str were changed to types but kept backward compatible. Oren
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