Chapter 14

Creating and Using Classes

In This Chapter

arrow Defining the characteristics of a class

arrow Specifying the class components

arrow Creating your own class

arrow Working with the class in an application

arrow Working with subclasses

You’ve already worked with a number of classes in previous chapters. Many of the examples are easy to construct and use because they depend on the Python classes. Even though classes are briefly mentioned in previous chapters, those chapters largely ignore them simply because discussing them wasn’t immediately important.

Classes make working with Python code more convenient by helping to make your applications easy to read, understand, and use. You use classes to create containers for your code and data, so they stay together in one piece. Outsiders see your class as a black box — data goes in and results come out.

remember.eps At some point, you need to start constructing classes of ...

Get Beginning Programming with Python For Dummies 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.