property
is a descriptor, which changes the way Python handles attribute access. The Python docs have an article introducing descriptors.
When Python accesses an attribute that points to an object with a __get__
method, it will return what that method returns instead of the object itself. Similarly, =
will delegate to __set__
and del
to __delete__
. The special methods are described in the docs.