Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Part 1: Core Python > Classes and OOP

Chapter 13. Classes and OOP

Chapter Topics

  • Introduction

  • Object-Oriented Programming

  • Classes

  • Instances

  • Binding and Method Invocation

  • Subclassing, Derivation, and Inheritance

  • Built-in Functions

  • Types vs. Classes/Instances

  • Customizing Classes with Special Methods

  • Privacy

  • Delegation and Wrapping

  • Related Modules

Classes finally introduce the notion of object-oriented programming (OOP) to our picture. We will first present a high-level overview, covering all the main aspects of using classes and OOP in Python. The remainder of the chapter covers all the details on classes, class instances, and methods. We will also describe derivation or subclassing in Python and what its inheritance model is. Finally, Python provides special attributes which allow the programmer to customize classes with special functionality, including those which overload operators and emulate Python types. We will show you how to implement some of these special methods to customize your class to attain type-like behavior.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial