going one step furtherwe can specify setter function for the new property as followsclass foo@property def foo(self)return self _foo @foo setter def foo(selfvalue)self _foo value this syntax looks pretty oddalthough the intent is obvious firstwe decorate the foo method as getter thenwe decorate second method with exactly the same name by applying the setter attribute of the originally decorated foo methodthe property function returns an objectthis object always comes with its own setter attributewhich can then be applied as decorator to other functions using the same name for the get and set methods is not requiredbut it does help group the multiple methods that access one property together we can also specify deletion function with @foo deleter we cannot specify docstring using property decoratorsso we need to rely on the property copying the docstring from the initial getter method here' our previous silly class rewritten to use property as decoratorclass silly@property def silly(self)"this is silly propertyprint("you are getting silly"return self _silly @silly setter def silly(selfvalue)print("you are making silly {}format(value)self _silly value @silly deleter def silly(self)print("whoahyou killed silly!"del self _silly this class operates exactly the same as our earlier versionincluding the help text you can use whichever syntax you feel is more readable and elegant