[Python-Dev] dir, part 2 (original) (raw)
Guido van Rossum guido at python.org
Fri Nov 10 22:12:19 CET 2006
- Previous message: [Python-Dev] __dir__, part 2
- Next message: [Python-Dev] __dir__, part 2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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/)
- Previous message: [Python-Dev] __dir__, part 2
- Next message: [Python-Dev] __dir__, part 2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]