def setter(self, func):
    'Set the function as a class method, and store as an attribute.'
    if (not isinstance(func, (classmethod, staticmethod))):
        func = classmethod(func)
    self.fset = func
    return self
Set the function as a class method, and store as an attribute.
def setter(self, func):
    
    if (not isinstance(func, (classmethod, staticmethod))):
        func = classmethod(func)
    self.fset = func
    return self