looking up an instance's methods

Shakeeb Alireza sa at bayt.net
Thu Aug 9 13:25:59 EDT 2001


Tim Peters wrote in message on thread
http://groups.google.com/groups?hl=en&safe=off&th=2f6a49e6e48ee0af,4
Subject: RE: Python2.2 doesn't give members of a list

TP> That is, it's always been the case that dir(class_instance) didn't display
TP> the methods of the class of which class_instance was an instance.  But
TP> objects of builtin types were not instances of classes, so dir() did
TP> something entirely different for them.  This is one consequence of the
TP> infamous "type/class split":  objects of builtin types and objects of
TP> user-defined classes act differently in subtle ways.  2.2 aims to repair
TP> that.

...

TP> Much as I hate doing it, for this reason I'm
TP> going to look into hacking inconsistent surprises back into dir().

(Shakeeb Alireza) wrote in a message 
SA> Is there any particular reason why one can't directly introspect an
SA> instance's methods (using dir(instance) for example) without having to
SA> call the __dict__ namespace of its class? Is this situation likely to
SA> change in Python 2.2?

Understand the situation a bit better. Thanks.

Regards,

Shakeeb



More information about the Python-list mailing list