G
Grzegorz Dostatni
Is it possible to call a method of a superclass? Let's say I have a
instance of class Bar ( subclassed from Foo).
Both Foo and Bar define a function h()
I want to call a.h() and have it go the Foo's implementation if it,
without going through the super() call (ie. do it from outside the
object).
I have a code in python that does it:
class Foo:
def h(self):
print "Foo"
class Bar(Foo):
def h(self):
print "Bar"
b = Bar()
b.h()
Greg
"When ideas fail, words come in very handy."
- Goethe (1749-1832)
instance of class Bar ( subclassed from Foo).
Both Foo and Bar define a function h()
I want to call a.h() and have it go the Foo's implementation if it,
without going through the super() call (ie. do it from outside the
object).
I have a code in python that does it:
class Foo:
def h(self):
print "Foo"
class Bar(Foo):
def h(self):
print "Bar"
b = Bar()
b.h()
Greg
"When ideas fail, words come in very handy."
- Goethe (1749-1832)