I want to be able to subclass a class, and define __init__
but still run the old __init__
as well.
To illustrate, say I have the following classes:
class A(object):
def __init__(self):
self.var1 = 1
class B(A):
def __init__(self)
self.var2 = 2
doInitForA()
And I want to be able to do this:
instB = B()
print (instB.var1) #1
print (instB.var2) #2
Edited as Ignacio Vazquez-Abrams suggested. (Is it possible to edit without bumping?)