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 takes 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 term of their conceptual differences and implementation details
  • Reuse code effectively through descriptors
  • Analyze examples of good uses of descriptors, and how to take advantage of them for our own libraries of APIs
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.171.58