In inheritance, what if we do not write 'super().init()' in child class' init() method? Does child class not call it by default?
No, it doesn't, as far as I know. As mentioned in the Zen of Python, Explicit is better than implicit. It's part of the language philosophy.
Explicit is better than implicit
We often need to handle passing data to the parent __init__() in a specific way, and we may need to do some other things first, so Python just assumes we know best how to handle that.
Imagine how maddening it could get if Python sometimes called it for you, but sometimes not! (Some languages actually are confusing like that, but Python aims to be obvious.)
Thanks for clarifying!
It would be very helpful if you also explain MRO (Method Resolution Order) in context of Python 3 in any upcoming series.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.