deciding when to use properties with the property built-in clouding the division between behavior and datait can be confusing to know which one to choose the example use case we saw earlier is one of the most common uses of propertieswe have some data on class that we later want to add behavior to there are also other factors to take into account when deciding to use property technicallyin pythondatapropertiesand methods are all attributes on class the fact that method is callable does not distinguish it from other types of attributesindeedwe'll see in python object-oriented shortcutsthat it is possible to create normal objects that can be called like functions we'll also discover that functions and methods are themselves normal objects the fact that methods are just callable attributesand properties are just customizable attributes can help us make this decision methods should typically represent actionsthings that can be done toor performed bythe object when you call methodeven with only one argumentit should do something method names are generally verbs once confirming that an attribute is not an actionwe need to decide between standard data attributes and properties in generalalways use standard attribute until you need to control access to that property in some way in either caseyour attribute is usually noun the only difference between an attribute and property is that we can invoke custom actions automatically when property is retrievedsetor deleted let' look at more realistic example common need for custom behavior is caching value that is difficult to calculate or expensive to look up (requiringfor examplea network request or database querythe goal is to store the value locally to avoid repeated calls to the expensive calculation we can do this with custom getter on the property the first time the value is retrievedwe perform the lookup or calculation then we could locally cache the value as private attribute on our object (or in dedicated caching software)and the next time the value is requestedwe return the stored data here' how we might cache web pagefrom urllib request import urlopen class webpagedef __init__(selfurl)self url url self _content none @property