Advanced Python #6 | Super method for Class __init__ and Method Resolution Order (MRO)

preview_player
Показать описание
Advanced Python #6 | Super method for Class __init__ and Method Resolution Order (MRO)

In this tutorial, we'll learn why to use super method instead of class-name based initialization specifically to avoid the following cases-
1. In case of changes in __init__ method of parent class the subclass __init__ needs to change
2. As a new class is added you need to add a new CLASS_NAME.__init__() for that

The code used in this tutorial is available here-

#python #advanced #super #inheritance
Рекомендации по теме
Комментарии
Автор

If this tutorial was helpful for you, please leave a thumbs up and subscribe to my channel 😊

MakeesyAI