Chapter 20. Advanced object-oriented features
This chapter covers
- Using special method attributes
- Making an object behave like a list
- Subclassing built-in types
- Understanding metaclasses
- Creating abstract base classes
This chapter will focus on some more advanced object-oriented features of Python. Python is distinguished by the ability to modify its objects in ways that can fundamentally change their behavior. For C++ users, this is somewhat similar to operator overloading, but in Python it’s more comprehensive and easier to use.
In addition to modifying the behavior of objects, you can also control the behavior of classes and the creation of their instances. Obviously, you’ll need to be fairly familiar with OO programming to use this feature. ...
Get The Quick Python Book, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.