If you're new to Python and you have read Chapter 13 on classes, you might be groaning at the prospect of yet another chapter on classes. Actually, almost everything in Chapter 13 also applies to the new-style classes we discuss in this chapter. New-style classes simplify Python's object hierarchy in ways that save you effort if you want to make changes to a built-in data type. They come with some new features that are of interest mostly in advanced programming. We discuss them here so you'll recognize them in programs.
This chapter provides an introduction to new-style classes and their features. You also find out about method resolution order and two features you shouldn't use—static methods and the_slots_class attribute.
Was this article helpful?