Chapter 3. Objects in Python
So, we now have a design in hand and are ready to turn that design into a working program! Of course, it doesn't usually happen this way. We'll be seeing examples and hints for good software design throughout the module, but our focus is object-oriented programming. So, let's have a look at the Python syntax that allows us to create object-oriented software.
After completing this chapter, we will understand:
- How to create classes and instantiate objects in Python
- How to add attributes and behaviors to Python objects
- How to organize classes into packages and modules
- How to suggest people don't clobber our data
Creating Python classes
We don't have to write much Python code to realize that Python is a very "clean" language. When we want to do something, we just do it, without having to go through a lot of setup. The ubiquitous "hello world" in Python, as you've likely seen, is only one line.
Similarly, the simplest...