A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-November/030187.html below:

[Python-Dev] Python interface to attribute descriptors

[Python-Dev] Python interface to attribute descriptors [Python-Dev] Python interface to attribute descriptorsGuido van Rossum guido@python.org
Thu, 14 Nov 2002 10:40:01 -0500
> Question: how could the descriptor "know" the name "x" if it is created
> by a descriptor-creating statement such as x = descriptor_creator(...).
> I guess one could do this by making a metaclass that would look for the
> descriptors in the class and "poke" the name into them but is there
> another way? In the example below I evaded this question by making the
> name an argument to positive's constructor.

Yes, those are the only ways I know of.  In retrospect it might have
been useful to give the descriptor API an extra argument for the
attribute name, but it's a bit late for that now.

--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