There were two errors in your program:
from functools import wraps class Basic(object): def __init__(self): print "Basic::init" def myDeco(name):
Now this gives the following result:
test <class '__main__.Derived'> Basic::init Derived::init
First you need a class, as others have pointed out.
The second super(Derived, self).__init__() called infinite recursion:
Traceback (most recent call last): File "<pyshell#8>", line 1, in <module> exec s File "<string>", line 32, in <module> File "<string>", line 28, in __init__ File "<string>", line 28, in __init__ File "<string>", line 28, in __init__ File "<string>", line 28, in __init__
For the reasons given below.
source share