Python’s super() considered super! by Raymond Hettinger
Based on python print statement I guess you use python2. In this case this should work
Based on python print statement I guess you use python2. In this case this should work
class A(object): def __init__(self): self.aa = None class B(A): def __init__(self): super(B, self).__init()__ self.bb = None def main(): b_obj = B() print b_obj.aa if __name__ == '__main__': main()In python3 (and you should be using it, because python2 official support ends Jan, 1st 2020) same code will look like
class A(object): def __init__(self): self.aa = None class B(A): def __init__(self): super().__init()__ self.bb = None def main(): b_obj = B() print(b_obj.aa) if __name__ == '__main__': main()
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs