Reflection in Python?

anders777 at anders777 at
Wed Jun 30 12:30:04 EDT 1999

From: anders777 at

I've just started programming in Python, and I
could really use some help figuring out something.
 I'd like to implement Kent Beck's unit tester in
Python (someone posted a very nice alternative a
few weeks ago, but Junit's approach works better
for my project's needs).  How do I do the
equivalent of what Java calls reflection? I want
to do the following:

test = MathTest("testAdd")

where will run the "testAdd" method on
the MathTest object?  I also want to be able to
tell the user the name of the object (MathTest)
and the method in case the method fails.  Any

Anders Schneiderman
National Journal Daily Briefings Group

Sent via
Share what you know. Learn what you don't.

More information about the Python-list mailing list