How do mixins relying on `__init__` ensure they don't break the MRO chain?

Python interview question for Advanced practice.

Answer

They should accept args and kwargs and pass them to super().init

Explanation

Mixins should be transparent to arguments they don't use, forwarding everything up the chain via super().

Related Questions