O'Reilly logo

Introduction to Python® Programming and Developing GUI Applications with PyQT by B. M. Harwani

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 5. Classes

This chapter covers the following:

  • Defining classes

  • Using class attributes

  • Defining functions in a class

  • Accessing class variables in instance methods

  • Creating instances and initializing instance variables through the __init__() method

  • Using class and static methods

  • Understanding garbage collection

  • Understanding inheritance—single, multilevel, and multiple inheritance

  • Using access control specifiers

  • Method overriding

  • Operator overloading

  • Polymorphism

  • Using properties and descriptors

The Class Statement

Python supports object-oriented programming and provides reusable code in the form of classes. It is always better to use old code than to start from scratch because existing code has already been used and tested, so it saves time in debugging ...

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