It is pointless to make C.__init() explicitly call B.init().
If class C is derived from class B, then instantiating an object using
class C will automatically call C.init(), which in turn will
automatically call B.init.
Also, to help keep your sanity, define all the classes first then put
the real-time code at the bottom.
Class A is unused in your second example, so delete it - it just
confuses thing.
For now, just pass value objects as parameters rather than class objects.
Ray Pasco
`#----------------------------
class B():
def __init__( self, val ):
self.val = val
self.internalVal = 'BbB'
print
print "---- B __init__ argumentval is %s" % (self.val)
print "---- B __init__ internalVal is %s" % (self.internalVal)
#end __init B
def PrintMyVal( self ) :
print
print '---- B.val is %s' % (self.val)
print '---- B.valB is %s' % (self.internalVal)
#end PrintMyVal def
#end B class
``#----------------------------
``class C( B ):
def __init__( self, val ):
self.val = val
self.internalVal = 'CcC'
print
print "---- C __init__ argumentval is %s" % (self.val)
print "---- C __init__ internalVal is %s" % (self.internalVal)
self.instB = B( 'BBB' )
#end __init C
def PrintMyVal( self ) :
print
print '---- C.val is %s' % (self.val)
print '---- C.internaVal is %s' % (self.internalVal)
print '---- C.instB.val is %s' % (self.instB.val)
print '---- C.instB.intenalVal is %s' %
(self.instB.internalVal)
#end PrintMyVal def
#end C class
···
#----------------------------
instC = C( ‘CCC’ )
instC.PrintMyVal()
instC.instB.PrintMyVal()
#----------------------------
`