Introspect the class name of object?
steven at REMOVE.THIS.cybersource.com.au
Thu Nov 22 05:03:29 CET 2007
On Wed, 21 Nov 2007 18:55:21 -0800, Davy wrote:
> Hi all,
> How to get the class name of an object from an introspect way? For
> Class cls:pass
> obj = cls()
> I want to get function(obj) = 'cls'
obj.__class__ returns the class itself.
obj.__class__.__name__ returns the name of the class as a string.
More information about the Python-list