class super: def hello(self): self.data1 = 'spam' class sub(super): def hola(self): self.data2 = 'eggs'X = sub()X.__dict__{}print X.__class__print sub.__bases__print super.__bases__Y = sub()X.hello()print X.__dict__X.hola()print X.__dict__ print sub.__dict__print super.__dict__print sub.__dict__.keys(), super.__dict__.keys()print Y.__dict__print X.data1, X.__dict__['data1']X.data3 = 'toast'print X.__dict__X.__dict__['data3'] = 'ham'print X.data3print X.__dict__print X.__dict__.keys()print dir(X)print dir(sub)print dir(super)
Name (required)
email (will not be published) (required)
Website