What is the problem with the following Python code ?
def decorator(cls): cls.attr = 10 @decorator class Object: attr = 11 obj = Object()
decorator does not return cls
cls
there is not constructor for Object
Object
attr is already defined as class attribute
attr
none, everything works fine