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