having trouble calling base class function in the following Python 2.3
script.
after reviewing this post:
Call a parent class's method from child class in Python?
I've generate this small piece of code:
class Base(object):
def func(self):
print "Base.func"
class Derived(Base):
def func(self):
super(Base, self).func()
print "Derived.func"
Derived().func()
code above generates this error:
Traceback (most recent call last):
File "py.py", line 13, in ?
Derived().func()
File "py.py", line 10, in func
super(Base, self).func()
AttributeError: 'super' object has no attribute 'func'
What am I missing?