Skip to content

Commit 6a05bc6

Browse files
committed
Multiple inheritance
1 parent 7b7191e commit 6a05bc6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,19 @@ class Employee(Person):
818818
>>> Employee.mro()
819819
[<class 'Employee'>, <class 'Person'>, <class 'object'>]
820820
```
821+
* **MRO or Method Resolution Order determines the order in which parent classes are traversed when searching for a method.**
822+
823+
### Multiple Inheritance
824+
```python
825+
class A: pass
826+
class B: pass
827+
class C(A, B): pass
828+
```
829+
830+
```python
831+
>>> C.mro()
832+
[<class 'C'>, <class 'A'>, <class 'B'>, <class 'object'>]
833+
```
821834

822835
### Comparable
823836
* **If eq() method is not overridden, it returns `'id(self) == id(other)'`, which is the same as `'self is other'`.**

0 commit comments

Comments
 (0)