O'Reilly logo

The Quick Python Book by Naomi R. Ceder

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. Classes and object-oriented programming

This chapter covers

  • Defining classes
  • Using instance variables and @property
  • Defining methods
  • Defining class variables and methods
  • Inheriting from other classes
  • Making variables and methods private
  • Inheriting from multiple classes

In this chapter, we discuss Python classes, which can be used in a manner analogous to C structures but which can also be used in a full object-oriented manner. For the benefit of readers who aren’t object-oriented programmers, we’ll discuss the use of classes as structures in the first two subsections.

The remainder of the chapter discusses OOP in Python. This is only a description of the constructs available in Python; it’s not an exposition on object-oriented ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required