Advanced Python: Object-Oriented Programming

Advanced Python: Object-Oriented Programming

1h 21mAdvanced2024-03-22

Authors

Miki Tebeka

Miki Tebeka

CEO at 353Solutions

Course details

In this advanced course, Miki Tebeka, the CEO at 353Solutions, guides you through object-oriented programming features in Python. Learn about attribute access and how to use properties, name mangling, descriptors, and more. Explore using class methods, static methods, mixin classes, and abstract base classes. Dive into sequences, mappings, numbers, and callable types. Find out what metaclasses are and how you can use them. Plus, go over class creation utilities that you’ll need to use. Each chapter comes with a hands-on challenge to practice and reinforce what you learn.

Skills covered

Object-Oriented ProgrammingPythonProgramming LanguagesOpen SourceSoftware DevelopmentOne-Off

Concepts

Introduction

  • Advanced object oriented programming (OOP)
  • What you should know
  • Using Codespaces

Attribute Access

  • Deconstructing attribute access
  • Using properties
  • Programmatic attribute access
  • Reducing memory with slots
  • Name mangling
  • Descriptors
  • Challenge - Colors
  • Solution - Colors

Methods

  • Using class methods
  • Using static methods
  • Mixin classes
  • Abstract base classes
  • Defining interfaces with typing.Protocol
  • Challenge - Event from JSON
  • Solution - Event from JSON

Special Methods

  • String representations
  • Sequences
  • Mappings
  • Numbers
  • Callable
  • Challenge - Database-backed dictionary
  • Solution - Database-backed dictionary

Metaclasses

  • What are metaclasses
  • Class creation
  • Instance creation
  • Attribute lookup
  • Challenge - Singleton
  • Solution - Singleton

Class Creation Utilities

  • Class decorators
  • namedtuple()
  • dataclass()
  • Freezing
  • Challenge - VM class
  • Solution - VM class

Conclusion

  • Next steps
40,000 Toman