Python Object-Oriented Programming (2020)

Python Object-Oriented Programming (2020)

1h 36mIntermediate2020-06-03

Authors

Joe Marini

Joe Marini

Senior Developer Advocate at Google, Developer

Course details

The object-oriented programming (OOP) features in Python make it easier to build programs of increasing complexity and modularity. In this course, you can learn how to apply core OOP principles like inheritance and composition along with some Python-specific features like “magic” methods and data classes to build programs that are extensible and efficient. Begin by brushing up on some object-oriented basics, and then use Python features like magic methods to make your classes integrate tightly with the Python language and data classes to dramatically reduce the amount of boilerplate code needed to build data-centric objects.

Topics include:
Defining classes
Checking instance types
Using multiple inheritance
Creating objects with composition
Leveraging magic methods
Calling objects like functions
Defining data classes
Creating immutable data classes

Skills covered

Object-Oriented ProgrammingPythonProgramming LanguagesOpen SourceSoftware DevelopmentOne-Off

Concepts

Introduction

  • Python object-oriented programming
  • What you should know
  • Setting up the development environment

Objected-Oriented Python

  • Object-oriented programming refresher
  • Basic class definition
  • Instance methods and attributes
  • Checking instance types
  • Class methods and members

Inheritance and Composition

  • Understanding inheritance
  • Abstract base classes
  • Using multiple inheritance
  • Interfaces
  • Understanding composition

Magic Object Methods

  • What are magic methods
  • String representation
  • Equality and comparison
  • Attribute access
  • Callable objects

Data Classes

  • Defining a data class
  • Using post initialization
  • Using default values
  • Immutable data classes

Conclusion

  • Next steps
40,000 Toman