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/2006-November/069944.html below:

[Python-Dev] __dir__, part 2

[Python-Dev] __dir__, part 2 [Python-Dev] __dir__, part 2Guido van Rossum guido at python.org
Fri Nov 10 22:12:19 CET 2006
On 11/10/06, Fredrik Lundh <fredrik at pythonware.com> wrote:
> Guido van Rossum wrote:
>
> > I think that ought to go into the guidlines for what's an acceptable
> > __dir__ implementation. We don't try to stop people from overriding
> > __add__ as subtraction either.
>
> to me, overriding dir() is a lot more like overriding id() than over-
> riding "+".  I don't think an object should be allowed to lie to the
> introspection mechanisms.

Why not? You can override __class__ already. With a metaclass you can
probably override inspection of the class, too.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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