[Python-Dev] dir() in inspect.py ? (original) (raw)

Meador Inge meadori at gmail.com
Mon May 21 01:55:03 CEST 2012


On Tue, May 15, 2012 at 3:13 PM, Christian Tismer <tismer at stackless.com> wrote:

Is the usage of dir() correct in this context or is the doc right? It would be nice to add a sentence of clarification if the use of dir() is in fact the correct way to implement inspect.

There is already a note in the inspect.getmembers documentation (http://docs.python.org/library/inspect.html#inspect.getmembers):

""" Note

getmembers() does not return metaclass attributes when the argument is a class (this behavior is inherited from the dir() function). """

In any case, open a tracker issue if you think the documentation needs to be improved or that there might be a bug.

-- Meador



More information about the Python-Dev mailing list