November 2022
Beginner to intermediate
752 pages
19h 19m
English
Python developers are well familiar with the mantra, “Everything is an object.” When looking at the class system in Python, however, this becomes a paradox: If everything is an object, then what is a class? The seemingly arcane answer to that question unlocks another powerful tool in the Python toolbox: abstract base classes, which are one way of outlining expected behaviors of a type when using duck typing.
In this chapter, I’ll be digging into metaclasses, abstract base classes, and how you can use them to write more maintainable classes.
Classes are instances of metaclasses, in the same way that objects ...
Read now
Unlock full access