Introduction
In Chapter 4, Extending Python, Files, Errors, and Graphs, you began to move beyond the basic and fundamental, into writing defensive code and anticipating potential issues. In this chapter, you are introduced to one of the cornerstones of object-oriented programming (OOP): classes. Classes contain the definition of the objects we work with. All objects you work with in OOP are defined by a class, either in your code, or in a python library. So far in this course we have been using this, but we have not discussed how to extend and customize the behavior of objects. In this chapter you start with objects you are familiar with and build on these by introducing the concept of classes.
Perhaps you have been working with a string object in Python. What exactly is a string? What sort of things can you do with strings? Are there things you'd like to be able to do with strings that Python's string object doesn't allow? Can you customize the behavior of this...