I was trying my hands on super function, below is the code i was executing.
class scene(object):
def enter(self):
print "a vllan s n your way. what you'll do?"
class centralcorrdor(scene):
print "startng pont of the game."
super(centralcorrdor,self).enter()
a = centralcorrdor()
however this gives error.
class centralcorrdor(scene):
File "game.py", line 8, in centralcorrdor
super(centralcorrdor,self).enter()
NameError: name 'centralcorrdor' is not defined
And this does not.
class scene(object):
def enter(self):
print "a vllan s n your way. what you'll do?"
class centralcorrdor(scene):
#print "startng pont of the game."
def func(self):
super(centralcorrdor,self).enter()
#scene.enter()
a = centralcorrdor()
a.func()
Can someone tell why? Is it that super has be called from inside a method in child class?