the example in the prior section simply traces attribute accesses usuallythoughproperties do much more--computing the value of an attribute dynamically when fetchedfor example the following example illustratesclass propsquaredef __init__(selfstart)self value start def getx(self)return self value * def setx(selfvalue)self value value property(getxsetxon attr fetch on attr assign no delete or docs propsquare( propsquare( two instances of class with property each has different state information print( xp print( xprint( * * * ( this class defines an attribute that is accessed as though it were static databut really runs code to compute its value when fetched the effect is much like an implicit method call when the code is runthe value is stored in the instance as state informationbut each time we fetch it via the managed attributeits value is automatically squaredc:\codepy - prop-computed py notice that we've made two different instances--because property methods automatically receive self argumentthey have access to the state information stored in instances in our casethis means the fetch computes the square of the subject instance' own data coding properties with decorators although we're saving additional details until the next we introduced function decorator basics earlierin recall that the function decorator syntax@decorator def func(args)is automatically translated to this equivalent by pythonto rebind the function name to the result of the decorator callabledef func(args)func decorator(func managed attributes