Subclasses in Python

Robert Brewer fumanchu at amor.org
Thu Apr 29 11:57:12 EDT 2004


Thomas Philips wrote:
> I ... used self.__Class__.<whatever I need to access> to access
> the class attributes in the class and subclass. Works like a charm,
> but I'm having some difficulty printing class names. I want
> self.__class__ to return just the name of the class without some
> ancillary stuff thrown in.

Try self.__class__.__name__


FuManChu




More information about the Python-list mailing list