How to list currently defined classes, methods etc

Colin J. Williams cjw at sympatico.ca
Fri Dec 2 21:22:30 CET 2005


Deep wrote:
> I have been looking a bit and am stuck at this point.
> 
> Given a string, how do i find what is the string bound to.
> Let me give an example.
> 
> def deep():
>      print "Hello"
> 
> now inspect.ismethod(deep) returns true. (As it should).
> But if I am trying to make a list of all bound methods), i use
> dir(), which is a list of strings. I get the string "deep" from this
> list.
> How do I obtain the reference to the method it is bound to.
> The same problem can be extended to attributes and classes.
> 
 >>> help('deep') in the interactive mode gives part of what you seek.

A prettier way is to use epydoc: 
http://www.answers.com/main/ntquery?s=epydoc&gwp=13

Colin W.



More information about the Python-list mailing list