How to find the classname of an object? (was Python Documentation)

Christopher J. Bottaro cjbottaro at alumni.cs.utexas.edu
Thu May 12 19:21:54 EDT 2005


I actually want all the parent classes too.  So if D derives off C derives
off B derives off A, I ultimately want a tuple ('D', 'C', 'B', 'A').

For those of you following the Python Documentation thread, this is a good
example of how the PHP manual is "better".  I found how to do this in a few
seconds in PHP.  I searched the Python docs for "class name", "classname",
"introspection" and "getclass".  I looked in the Class section of the
tutorial also and also the Programming FAQ.  The "related functions"
section of the PHP manual is really helpful.  It would be cool if in the
section for the built-in function isinstance() or issubclass() there is a
section for "related functions" that would point me to getclassname(obj)
(if it exists).

Thanks for the help.

-- C




More information about the Python-list mailing list