September 2021
Beginner to intermediate
352 pages
11h 27m
English
Classes are used to create new kinds of objects. This chapter covers the details of classes—but is not intended to be an in-depth reference on object-oriented programming and design. Some programming patterns common in Python are discussed, as well as ways that you can customize classes to behave in interesting ways. The overall structure of this chapter is top-down. High-level concepts and techniques for using classes are described first. In later parts of the chapter, the material gets more technical and focused on internal implementation.
Almost all code in Python involves creating and performing actions on objects. For example, you might make a string object and manipulate it as follows: ...