+4  A: 

Your decorator is not necessary. The only thing the decorator does that can't be done with the standard syntax is prevent keyword args from absorbing positional arguments. Thus

class Base(object):
    def __init__(name=None,surname=None,age=None):
        #some code

class Child(Base):
    def __init__(test=None,**kwargs):
        Base.__init__(self,**kwargs)

The advantage of this is that kwargs in Child will not contain test. The problem is that you can muck it up with a call like c = Child('red herring'). This is fixed in python 3.0.

The problem with your approach is that you're trying to use a decorator to do a macro's job, which is unpythonic. The only thing that will get you what you want is something that modifies the locals of the innermost function (f in your code, specifically the kwargs variable). How should your decorator know the wrapper's insides, how would it know that it calls a superclass?

David Berger
I understand you point of view, and I did think about using *args, but that gives me a problem, I do not want to have to do the following:example = Base(u"", u"", 26)and will prefer to use:example = Base(age=29)The reasoning of using kwargs is that I have lots of arguments and I do not want the developer to have to pass all the default values!
mandel
The way David wrote the code, you don't have to supply the default arguments. You can construct a Base with Base(age=29).
Ned Batchelder
Indeed, but I want to perform the check in every class and I though that the use of a decorator would increase the code reuse. I do not want to have to add the check in every object. I prefer the use of a decorator but even if I use a function, I would have the same problem.
mandel