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

    This situation becomes more complex when inheritance starts crossing paths (for example if First inherited from Second). Read the link above for more details, but, in a nutshell, Python will try to …

  2. python - Overriding default values when using inheritance in ...

    When you use Python inheritance to create dataclasses, you cannot guarantee that all fields with default values will appear after all fields without default values.

  3. class - Why do Python classes inherit object? - Stack Overflow

    Apr 9, 2022 · 1265 Is there any reason for a class declaration to inherit from object? In Python 3, apart from compatibility between Python 2 and 3, no reason. In Python 2, many reasons.

  4. oop - What does 'super' do in Python? - Stack Overflow

    Nov 3, 2015 · When another class subclasses the class you wrote, it could also be inheriting from other classes. And those classes could have an __init__ that comes after this __init__ based on the …

  5. class - Understanding Python super () with __init__ () methods - Stack ...

    Feb 23, 2009 · Just a heads up... with Python 2.7, and I believe ever since super() was introduced in version 2.2, you can only call super() if one of the parents inherit from a class that eventually inherits …

  6. python - Why don't my subclass instances contain the attributes from ...

    Arrow is using single inheritance from base class Base which in turn singly inherits from QGraphicsObject. I am definitely calling the super().__init__() appropriately.

  7. How to inherit and extend class attributes in Python?

    Jul 13, 2018 · In Python, class is an executable statement. When the interpreter finds a class statement, then first all the code in the class statement block is executed (in a special namespace), then all …

  8. python - Class inheritance across files - Stack Overflow

    @KasperLeth A base class rarely has to know about its subclasses. I think before you start splitting up source code into separate files/modules first you should have solid understanding of software design …

  9. class - Python inheritance - how to call grandparent method? - Stack ...

    Mar 25, 2017 · Python inheritance - how to call grandparent method? Ask Question Asked 8 years, 11 months ago Modified 7 months ago

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

    The difference between a mixin and standard multiple inheritance is just a matter of semantics; a class that has multiple inheritance might utilize a mixin as part of that multiple inheritance.