A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-March/043022.html below:

[Python-Dev] PEP 318 - generality of list; restrictions on elements

[Python-Dev] PEP 318 - generality of list; restrictions on elements [Python-Dev] PEP 318 - generality of list; restrictions on elementsOren Tirosh oren-py-l at hishome.net
Wed Mar 10 10:39:49 EST 2004
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



More information about the Python-Dev mailing list

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