[Python-bugs-list] [ python-Bugs-759525 ] inspect.getmembers broken (?)

SourceForge.net noreply@sourceforge.net
Mon, 23 Jun 2003 15:43:25 -0700


Bugs item #759525, was opened at 2003-06-23 22:43
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=759525&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Alexander Schmolck (aschmolck)
Assigned to: Nobody/Anonymous (nobody)
Summary: inspect.getmembers broken (?)

Initial Comment:
inspect.getmembers currently uses `dir` to obtain a
list of an object's "members", which omits certain
things such as methods of the metaclass, e.g:

  >>> 'mro' in dict(inspect.getmembers(int))
  0

Since I can't find a description of what exactly
constitutes a "member", it is not strictly possible to
tell whether this is the intended behavior, but then
the documentation should be updated in this case to
clarify the semantics more.

It currently seems quite hard to answer seemingly
innocuous questions such as "What are the methods of
class/type X?" with introspection. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=759525&group_id=5470