getting the class name of a subclass

Dan Sommers me at privacy.net
Wed Jul 20 11:32:09 EDT 2005


On Wed, 20 Jul 2005 14:06:57 GMT,
flupke <flupke at nonexistingdomain.com> wrote:

> file class_name.py
> ========================
> class A(object):
>      def __init__(self):
>          print "I'm A"

>      def printclass(self):
>          print "Name ",__name__
>          print "Class ",A.__name__

Why "A.__name__" and not "self.__class__.__name__"?

Regards,
Dan

-- 
Dan Sommers
<http://www.tombstonezero.net/dan/>



More information about the Python-list mailing list