Re: getting the class name of a subclass

2005-07-20 Thread Dan Sommers
On Wed, 20 Jul 2005 14:06:57 GMT, flupke <[EMAIL PROTECTED]> 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.__

Re: getting the class name of a subclass

2005-07-20 Thread flupke
George Sakkis wrote: > Make printclass a class method: > > class A(object): > def __init__(self): > print "I'm A" > > # for python 2.4 > @classmethod > def printclass(cls): > print "Module", cls.__module__ > print "Class", cls.__name__ > # for 2.3 or

Re: getting the class name of a subclass

2005-07-20 Thread George Sakkis
"flupke" <[EMAIL PROTECTED]> wrote: > I have the following test code setup, trying to get the class name of a > subclass in the super class. (Reason why i want this is described below) > > file class_name_start.py > > import class_name as cn > > obj = cn.B() > obj.printcla

getting the class name of a subclass

2005-07-20 Thread flupke
I have the following test code setup, trying to get the class name of a subclass in the super class. (Reason why i want this is described below) file class_name_start.py import class_name as cn obj = cn.B() obj.printclass() file class_name.py =