[Zope-dev] Python 2.3.2 and dir

Alan Milligan alan at balclutha.org
Sun Dec 14 21:45:36 EST 2003


Hi,

I'm trying to upgrade my Zpydoc product to Python 2.3.2 from 2.1.3 and 
have come across a confusing situation in regard to the 
inspect.getmembers function.

This function uses the builtin dir() function to get a list of an 
objects attributes.  For Zope products, I am getting a situation where 
returned attributes are not found in the object - explicitly __call__, 
__delattr__, etc etc.

I suspect this has something to do with python 2.2 class changes, and 
issues with ExtensionClass not behaving like a first class Python 
object.  If someone can give me a complete explaination, I can decide 
upon appropriate behaviour..

In addition, there's a caveat upon the dir() function:

Note: Because dir() is supplied primarily as a convenience for use at an 
interactive prompt, it tries to supply an interesting set of names more 
than it tries to supply a rigorously or consistently defined set of 
names, and its detailed behavior may change across releases.


While this is fine for dir(), surely we do expect consistency across 
releases for inspect.getmembers....





More information about the Zope-Dev mailing list