in the previous subsection we noted that no validation is performed on the circle' radius attribute we can provide validation by making radius into property this does not require any changes to the circle __init__(methodand any code that accesses the circle radius attribute will continue to work unchanged--only now the radius will be validated whenever it is set python programmers normally use properties rather than the explicit getters and setters ( getradius(and setradius()that are so commonly used in other object-oriented languages this is because it is so easy to change data attribute into property without affecting the use of the class to turn an attribute into readable/writable property we must create private attribute where the data is actually held and supply getter and setter methods here is the radius' gettersetterand docstring in full@property def radius(self)"""the circle' radius circle circle(- traceback (most recent call last)assertionerrorradius must be nonzero and non-negative circle circle( circle radius - traceback (most recent call last)assertionerrorradius must be nonzero and non-negative circle radius ""return self __radius @radius setter def radius(selfradius)assert radius "radius must be nonzero and non-negativeself __radius radius we use an assert to ensure nonzero and non-negative radius and store the radius' value in the private attribute self __radius notice that the getter and setter (and deleter if we needed oneall have the same name--it is the decorators that distinguish themand the decorators rename them appropriately so that no name conflicts occur the decorator for the setter may look strange at first sight every property that is created has gettersetterand deleter attributeso once the radius property is created using @propertythe radius getterradius setterand radius deleter attributes become available the radius getter is set to the