Python2.2 doesn't give members of a list

Mats Wichmann xyzmats at laplaza.org
Thu Aug 9 14:56:20 EDT 2001


On 9 Aug 2001 08:58:32 -0700, paul at boddie.net (Paul Boddie) wrote:

:"Tim Peters" <tim.one at home.com> wrote in message news:<mailman.997328534.2490.python-list at python.org>...
:>
:> The new scheme is better because more consistent and predictable, but the
:> change in dir(builtin_object) is starting to look like it *may* be a bad
:> incompatibility with 2.1.  Much as I hate doing it, for this reason I'm
:> going to look into hacking inconsistent surprises back into dir().
:> 
:> although-nothing-can-make-everyone-happy-ly y'rs  - tim
:
:Absolutely not! I was initially surprised that dir(object) didn't give
:the methods as well as the attributes, and disappointed that
:dir(object.__class__) doesn't state the methods available on that
:object. 
....

: Instead, that
:is left up to the programmer, unless he/she decides upon using the new
:introspection module(s).
:
:Perhaps there should be a well-known and widely published way of doing
:this kind of thing, but dir is a well-known function. It's a shame
:about dir([])...

I think so too.  Introspection seems to me to be a feature that should
be easier, rather than harder, to get to.  dir() has done part of the
that job, albeit inconsistently (funny, it didn't seem inconsistent
after I got used to it).  I'd be sad to have less information
available to dir().   I should warn that I'm coming at this mostly
from the idea of teaching Python, which is something I do (less often
than I'd like, sadly).

Mats Wichmann

(Anti-spam stuff: to reply remove the "xyz" from the
address xyzmats at laplaza.org. Not that it helps much...)



More information about the Python-list mailing list