Recovering method names at runtime

Adrian Eyre a.eyre at optichrome.com
Fri Oct 29 11:47:45 EDT 1999


> Is there any way to get a list of the method names of a class at runtime
> (like, for example, the Java reflection API)? I'm intending to write a
> class browser.

Python 1.5.2 (#2, Oct 19 1999, 15:40:00) [C] on sunos5
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> class A:
...  def b(self):pass
... 
>>> A.__dict__
{'b': <function b at e8fa0>, '__module__': '__main__', '__doc__': None}
>>> ^D

--------------------------------------------
Adrian Eyre <mailto:a.eyre at optichrome.com>
Optichrome Computer Solutions Ltd
Maybury Road, Woking, Surrey, GU21 5HX, UK
Tel: +44 1483 740 233  Fax: +44 1483 760 644
http://www.optichrome.com 
--------------------------------------------





More information about the Python-list mailing list