On 11/10/06, Fredrik Lundh <[EMAIL PROTECTED]> 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/) _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com