My code is as follows, where sdl2ext.Entity
is a third party class.
class Grid(sdl2ext.Entity):
def __init__(self, world):
self.w = 3
self.h = 3
super(Grid,self).__init__()
def dump(self):
print(self.w)
def run():
world = sdl2ext.World()
g = Grid(world)
g.dump()
if __name__ == "__main__":
run()
The specific error that I get is with the line print(self.w)
:
AttributeError: object ''Grid'' has no attribute ''w''
Is this something to do with not initialising the underlying base object, sdl2ext.Entity
?