(original) (raw)
What about \_\_getlocalattribute\_\_ or \_\_getattributenorecurse\_\_? Long, but this isn't going to be used often.
Putting "type" or "class" in the name would be misleading. It's an instance method (that is most useful when implemented on a metaclass).
(Apologies for the top post.)
Sent from my Windows Phone
Putting "type" or "class" in the name would be misleading. It's an instance method (that is most useful when implemented on a metaclass).
(Apologies for the top post.)
Sent from my Windows Phone
From: Steven D'Aprano
Sent: �9/�12/�2013 16:09
To: python-dev@python.org
Subject: Re: \[Python-Dev\] PEP 447: add type.\_\_locallookup\_\_
On Thu, Sep 12, 2013 at 04:42:39PM +0200, Ronald Oussoren wrote:
\> I don't particularly like \_\_locallookup\_\_ either, but haven't found a
\> better name yet. "\_\_lookup\_in\_class\_\_" was the best alternative I
\> could come up with, and that feels different than other special
\> methods. The name in the PEP is more or less derived from
\> \_PyType\_Lookup, with "local" meaning "only in this class, don't
\> recurse in the rest of the MRO".
How about \_\_typelookup\_\_ ? Surely that's the obvious name to derive from
\_PyType\_Lookup :-)
\--
Steven
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com
\> I don't particularly like \_\_locallookup\_\_ either, but haven't found a
\> better name yet. "\_\_lookup\_in\_class\_\_" was the best alternative I
\> could come up with, and that feels different than other special
\> methods. The name in the PEP is more or less derived from
\> \_PyType\_Lookup, with "local" meaning "only in this class, don't
\> recurse in the rest of the MRO".
How about \_\_typelookup\_\_ ? Surely that's the obvious name to derive from
\_PyType\_Lookup :-)
\--
Steven
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/steve.dower%40microsoft.com