This Python OOP
explains to you the Python object-oriented programming clearly so that you can apply it to develop software more effectively.
By the end of this Python OOP module, you’ll have good knowledge of object-oriented principles. And you’ll know how to use Python syntax to create reliable and robust software applications.
What you’ll learn:
- Create objects in Python by defining classes and methods.
- Extend classes using inheritance.
- SOLID principles in object-oriented programming.
- Section 1. Classes and objects
- Object Oriented Programming – introduce to you the important concepts in Python object-oriented programming
- Class – learn how to define a class and create new objects from the class
- Class variables – explain the class variables (or attributes)
- Instance methods – guide you on instance methods and help you understand the differences between a function and a method.
- init method – show you how to use the init method to initialize object’s attributes.
- Instance variables – understand the instance variables.
- Class methods - understand the class methods.
- Private attributes – learn about private attributes and how to use them effectively.
- Class attributes – understand class attributes and more importantly when you should use class attributes.
- Static methods – explain to you static methods and shows you how to use them to group related functions in a class.
- Section 2. Special methods
- str method – show you how to use the str dunder method to return the string representation of an object.
- repr method – learn how to use the repr method and the main difference between str and repr methods.
- eq method – learn how to define the equality logic for comparing objects by values.
- bool method – guide you on how to determine whether a custom object is True or False using the bool method.
- Section 3. Property
- Property – show you how to use the property class to create a property.
- @property decorator – learn how to use the @property decorator to create a property.
- Read-only property – learn how to define read-only properties and use them for computed properties
- Delete a property – guide you on how to delete a property from an object.
- Section 4. Single inheritance
- Inheritance – explain to you the inheritance concept and how to define a class that inherits from another class.
- Overriding methods – show you how overriding methods work.
- super – learn how to delegate to the methods of the parent class from a method in the child class
- slots – use slots to make the class more memory efficient
- Abstract class – learn what abstract classes are and how to define abstract classes
- Protocol - use Python Protocol to define implicit interfaces.
- Section 5. Enumeration
- Enumeration – show you how to define a enumeration in Python.
- Enum Aliases & @enum.unique – introduce to you the enum aliases and how to use the enum.unique decorator to ensure the uniqueness of member values.
- Customize and extend enumerations – learn how to customize the behaviors of enum classes and how to extend the a custom enum class.
- auto – use the enum auto class to generate unique values for enumeration’s members.
- Section 7. Multiple inheritance
- Multiple inheritance – learn how to implement multiple inheritance and understand how the method resolution order (MRO) works in Python.
- Mixin – introduce to you the mixin concept and how to implement mixin in Python.
- Section 8. Descriptors
- Descriptors – explain how descriptors work and how to use them to make the code reusable.
- Data vs non-data descriptors – understand the differences between data and non-data descriptors.
- Section 9. Metaprogramming