About 67,000 results
Open links in new tab
  1. How does Python's super () work with multiple inheritance?

    In fact, multiple inheritance is the only case where super() is of any use. I would not recommend using it with classes using linear inheritance, where it's just useless overhead.

  2. python - Calling parent class __init__ with multiple inheritance, …

    As you've noticed, doing so would break multiple inheritance because you end up calling another class's __init__ rather than object.__init__(). (Disclaimer: Avoiding super().__init__() in object …

  3. python multiple inheritance passing arguments to constructors …

    Well, when dealing with multiple inheritance in general, your base classes (unfortunately) should be designed for multiple inheritance. Classes B and C in your example aren't, and thus you …

  4. python multiple inheritance from different paths with same …

    This is known as "diamond inheritance" and it is a big problem for many multiple inheritance systems (like in C++). Python's collaborative multiple inheritance (with super()) lets you solve …

  5. Python's Multiple Inheritance: Picking which super () to call

    Jan 8, 2013 · The point of all of this is to relieve you of having to explicitly pick which __init__ methods to call. The question here is why you don't want to call all of the superclass __init__ …

  6. python - What is a mixin and why is it useful? - Stack Overflow

    1021 A mixin is a special kind of multiple inheritance. There are two main situations where mixins are used: You want to provide a lot of optional features for a class. You want to use one …

  7. Python Multiple Inheritance super ().__init__ () - Stack Overflow

    Aug 26, 2022 · See python multiple inheritance passing arguments to constructors using super for more discussion of parameter passing to __init__() methods with multiple inheritance. So you …

  8. oop - Python multi-inheritance, __init__ - Stack Overflow

    Dec 31, 2011 · Python multiple inheritance is like a chain, in Child class mro, the super class of ParentA is ParentB, so you need call super().__init__() in ParentA to init ParentB.

  9. Python ABC Multiple Inheritance - Stack Overflow

    Mar 2, 2015 · 0 You could also set the other class's metaclass to ABCMeta so that all the multiple base classes's metaclass are ABCMeta. I had a similar problem when using multiple …

  10. oop - Mixin vs inheritance - Stack Overflow

    May 13, 2009 · In short, the key difference from an inheritance is that mix-ins does NOT need to have a "is-a" relationship like in inheritance. From the implementation point of view, you can …