Getting More Out of Our Objects with Descriptors
This chapter introduces a new concept that is more advanced in Python development since it features descriptors. Moreover, descriptors are not something programmers of other languages are familiar with, so there are no easy analogies or parallelisms to make.
Descriptors are another distinctive feature of Python that take object-oriented programming to another level, and their potential allows users to build more powerful and reusable abstractions. Most of the time, the full potential of descriptors is observed in libraries or frameworks.
In this chapter, we will achieve the following goals that relate to descriptors:
- Understand what descriptors are, how they work, and how to implement them effectively
- Analyze the two types of descriptors (data and non-data descriptors) in terms of their conceptual differences and implementation details
- Reuse code effectively through descriptors
- Analyze examples of...