__name__

Bill Scherer scherbi at bam.com
Fri Jan 14 11:33:33 EST 2000


I think you want:

    return self.__class__.__name__

-Bill

JB wrote:

> Could anyone tell me how to get a classes name:
>
> class MyClass:
>    def className( self ):
>        return self.__name__
>
> This doesn't fly. The docs say a class has the __name__ attribute but...
>
> thanks
> jb
>
> --
> There are bugs and then there are bugs.  And then there are bugs.
> -- Karl Lehenbauer
> --
> http://www.python.org/mailman/listinfo/python-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scherbi.vcf
Type: text/x-vcard
Size: 226 bytes
Desc: Card for Bill Scherer
URL: <http://mail.python.org/pipermail/python-list/attachments/20000114/315b87d1/attachment.vcf>


More information about the Python-list mailing list