Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
This chapter covered the various techniques for managing access
to attributes in Python, including the __getattr__ and __getattribute__ operator overloading
methods, class properties, and attribute descriptors. Along the way,
it compared and contrasted these tools and presented a handful of use
cases to demonstrate their behavior.
Chapter 38 continues our tool-building survey with a look at decorators—code run automatically at function and class creation time, rather than on attribute access. Before we continue, though, let’s work through a set of questions to review what we’ve covered here.