Highlights
- Learn Fundamentals: Classes and methods
- Explore Object Oriented Features
- Learn about Inside Python Objects
- Explore Python Protocols
- Try Alternative Approaches
- Understand Object oriented theories
- Learn Advanced OOP Concepts
- Utilise OOP Design Principles
The course fills in gaps on the low level details of Python whilst covering the full object model. Learn how all Python object works, Python objects inside and out. The course is hands on with exercises for all the topics. Principles of API design, objects for data abstraction, and best practises are discussed throughout the course.
Course Details
Fundamentals: Classes and methods
- Computer architecture and programming languages
- Python as a high-level, object-oriented language
- Objects as abstractions, for thinking
- The class statement
- The explicit self
- The initialiser method __init__
- Bound methods
- Attributes and the built-in attribute access functions
- References and assignment (how Python works)
- Mutable objects (and call by object)
- Object copying
Object Oriented Features
- Class attributes
- Class methods
- Properties
- Private attributes
- Single inheritance
- Inheritance to extend and modify the parent
- The use of super
- Cooperative multiple inheritance
- Inheritance as a type heirarchy
- Mixin Classes
- Attribute lookup and the method resolution order
- The type system: isinstance and issubclass
Inside Python Objects
- The instance dictionary
- Slots
- Class dictionaries
- The descriptor protocol
Python Protocols
- Magic methods and Python protocols
- The string representation protocol
- The container protocols
- Implementing custom containers
- Inheriting from collections.abc.MutableSequence
Alternative Approaches
- namedtuples
- dataclasses
- type as a class factory
Object oriented theory:
- History of Object Oriented Programming
- The pillars of OOP
- Abstraction
- Inheritance
- Encapsulation
- Polymorphism
- Inheritance and the "is a" relationship
- Object oriented design principles
- Design patterns
- The Liskov Substitution Principle
- Composition versus inheritance
Optional advanced topics (third day):
Advanced OOP Concepts:
- Interfaces and API design
- Abstract base classes and protocols
- Type hints and static typing with mypy
- Class decorators
- Metaclasses
- Context managers and the with statement
- Weak references and destructors
OOP Design Principles
- SOLID principles
- Law of Demeter
- Liskov Substitution Principle
- Composition vs inheritance
- Domain Driven Design
- Test Driven Development
- Stop writing classes
- The hexagon pattern (microservices)
- The C4 Model for system architecture
Who should attend
Object Oriented Programming Theory with Python is a practical two day course on the object oriented features of Python. Perfect for Developers with some experience of Python looking to use objects and classes and to understand them. An excellent course for data scientists, devops engineers and those self taught with Python looking to move beyond scripting into programming.
Feedback
4.8 out of 5 average
"I wanted to say this has been a really good course. The best one I have done. It's been very insightful and I have learnt a lot. Great solid foundation and goes in depth for OOP. Also, I really liked the explanations then use of exercises. I really like the exercises, they get you to think which helps solidify the knowledge. "
DH, Software Engineer, OO Python, November 2024
Watch live client feedback from Python Training course: