Можно так:
>>> class A( object):
def __new__( cls, parent=True ):
klass = object.__new__(cls)
if parent:
klass.a = cls(False)
return klass
def __init__( self, *parent ):
if ‘a’ in dir(self):
print ‘Hallo! I am a parent’
else:
print “Hallo! I am a child”
>>> a = A()
Hallo! I am a child
Hallo! I am a parent