Re: derived class name in python 2.6/2.7

2013-01-30 Thread Dave Angel
On 01/30/2013 03:05 PM, Sells, Fred wrote: This is simple, but I just cannot find it after quite a bit of searching I have this basic design class A: def __init__(self): print 'I am an instance of ', self.__class__.name class B(A): pass X = B I would like thi

Re: derived class name in python 2.6/2.7

2013-01-30 Thread Oscar Benjamin
On 30 January 2013 20:05, Sells, Fred wrote: > This is simple, but I just cannot find it after quite a bit of searching > > I have this basic design > > class A: > def __init__(self): > print 'I am an instance of ', self.__class__.name Did you mean to use __name__ instead

derived class name in python 2.6/2.7

2013-01-30 Thread Sells, Fred
This is simple, but I just cannot find it after quite a bit of searching I have this basic design class A: def __init__(self): print 'I am an instance of ', self.__class__.name class B(A): pass X = B I would like this to print "I am an instance of B" but I kee