I can't get super() to work in python 2.7
问题 With a simple pair of classes, I cannot get super working: class A(object): q = 'foo' class B(A): q = 'bar' def __init__(self): self.a = super(A, self).q a = B() errors like so: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-210-802575054d17> in <module>() 5 def __init__(self): 6 self.a = super(A, self).q ----> 7 a = B() <ipython-input-210-802575054d17> in __init__(self) 4 q = 'bar' 5 def __init__