object-oriented programming using properties to control attribute access |in the previous subsection the point class included distance_from_origin(methodand the circle class had the area()circumference()and edge_distance_from_origin(methods all these methods return single float valueso from the point of view of user of these classes they could just as well be data attributesbut read-onlyof course in the shapealt py file alternative implementations of point and circle are providedand all the methods mentioned here are provided as properties this allows us to write code like thiscircle shape circle( circle radius circle edge_distance_from_origin assumesimport shapealt as shape returns returns here are the implementations of the getter methods for the shapealt circle class' area and edge_ distance_from_origin properties@property def area(self)return math pi (self radius * @property def edge_distance_from_origin(self)return abs(self distance_from_origin self radiusif we provide only getters as we have done herethe properties are read-only the code for the area property is the same as for the previous area(method the edge_distance_from_origin' code is slightly different from before because it now accesses the base class' distance_from_origin property instead of calling distance_from_origin(method the most notable difference to both is the property decorator decorator is function that takes function or method as its argument and returns "decoratedversionthat isa version of the function or method that is modified in some way decorator is indicated by preceding its name with an at symbol (@for nowjust treat decorators as syntax--in we will see how to create custom decorators the property(decorator function is built-in and takes up to four argumentsa getter functiona setter functiona deleter functionand docstring the effect of using @property is the same as calling the property(function with just one argumentthe getter function we could have created the area property like thisdef area(self)return math pi (self radius * area property(areawe rarely use this syntaxsince using decorator is shorter and clearer