How should you design Service to ensure both parent initializers run properly without duplication?
hard📝 Application Q8 of 15
Python - Multiple Inheritance and Method Resolution
You have three classes: Logger, Authenticator, and Service. You want Service to inherit from both Logger and Authenticator. How should you design Service to ensure both parent initializers run properly without duplication?
AUse <code>super().__init__()</code> in all classes and ensure they call super() in their <code>__init__</code>.
BCall each parent <code>__init__</code> directly inside <code>Service.__init__</code>.
COnly call <code>Logger.__init__</code> in <code>Service</code> and skip <code>Authenticator</code>.
DDo not define <code>__init__</code> in <code>Service</code> to avoid conflicts.