name of a class (WAS two new wrinkles to the general class!)

Steven Bethard steven.bethard at gmail.com
Fri Nov 5 11:41:07 EST 2004


syd <syd.diamond <at> gmail.com> writes:
>
> On a related note, is there a good way from within a class to get the
> name in the simple form?


Does this work for you?

>>> class C(object):
... 	pass
... 
>>> C().__class__.__name__
'C'

Steve




More information about the Python-list mailing list