In OOP, super()
is very useful for the purpose of multiple-inheritance. It gives you access to methods and attributes from a superclass, to be used in a sub/child class, which saves a lot of time and effort.
The second init
call is used to access the superclass from the base/sub class. Where you pass in the arguments required by the superclass's init
constructor; such that when you instantiate the base/sub class, you only pass in the arguments required by its init
constructor only, not the arguments required for the superclass's init
constructor. A nice example of that is looking at the implementation in this answer.
Moreover, you can just write super().__init__()
without explicitly referring to the base class.