Author: admin
-
Python mixin
Summary: in this tutorial, you’ll learn about Python mixin classes and how to use them to make the code reusable. What is a mixin in Python A mixin is a class that provides method implementations for reuse by multiple related child classes. However, the inheritance is not implying an is-a relationship. A mixin doesn’t define a new…
-
Python Multiple Inheritance
Summary: in this tutorial, you’ll learn about Python multiple inheritance and how method order resolution works in Python. Introduction to the Python Multiple inheritance. When a class inherits from a single class, you have single inheritance. Python allows a class to inherit from multiple classes. If a class inherits from two or more classes, you’ll have multiple inheritance.…
-
Python Dependency Inversion Principle
Summary: in this tutorial, you’ll learn about the Python dependency inversion principle to make your code hi Introduction to the dependency inversion principle The dependency inversion principle is one of the five SOLID principles in object-oriented programming: The dependency inversion principle states that: The dependency inversion principle aims to reduce the coupling between classes by…
-
Python Interface Segregation Principle
Summary: in this tutorial, you’ll learn about the interface segregation principle and how to apply it in Python. Introduction to the interface segregation principle The interface segregation principle is one of five SOLID principles in object-oriented programming: An interface is a description of behaviors that an object can do. For example, when you press the…