Python class inheritance: AttributeError: '[SubClass]' object ...
stackoverflow.com › questions › 10268603Apr 22, 2012 · Python class inheritance: AttributeError: ' [SubClass]' object has no attribute 'xxx'. Bookmark this question. Show activity on this post. class Event (object): def __init__ (self, sr1=None, foobar=None): self.sr1 = sr1 self.foobar = foobar self.state = STATE_NON_EVENT # Event class wrappers to provide syntatic sugar class TypeTwoEvent (Event): def __init__ (self, level=None): self.sr1 = level self.state = STATE_EVENT_TWO.
Inheritance in Python - GeeksforGeeks
www.geeksforgeeks.org › inheritance-in-pythonSep 14, 2020 · Traceback (most recent call last): File "/home/de4570cca20263ac2c4149f435dba22c.py", line 12, in print (object.name) AttributeError: 'B' object has no attribute 'name' Different forms of Inheritance: 1. Single inheritance: When a child class inherits from only one parent class, it is called single inheritance. We saw an example above.