Properties in Detail

Learn about the property function in detail.

We'll cover the following...

The property() function

Think of the property function as returning an object that proxies any requests to get or set the attribute value through the method names we have specified. The property() built-in is like a constructor for such an object, and that object is set as the public-facing member for the given attribute.

This property() constructor can actually accept two additional arguments, a delete function and a docstring for the property. The delete function is rarely supplied in practice, but it can be useful ...