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....
Alan Milligan wrote at 2003-12-15 13:45 +1100:
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.
You know, I have a similar product ("DocFinder"). I directly look into the class' "__dict__" to learn about a class' members. -- Dieter
participants (2)
-
Alan Milligan -
Dieter Maurer