About 1,060,000 results
Open links in new tab
  1. Understanding Python super() with __init__() methods

    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 …

  2. How do I initialize the base (super) class? - Stack Overflow

    self.x = x class SubClass(SuperClass): def __init__(self, y): self.y = y # how do I initialize the SuperClass __init__ here? How do I initialize the SuperClass __init__ in the subclass? I am …

  3. 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.

  4. How to invoke the super constructor in Python? - Stack Overflow

    In line with the other answers, there are multiple ways to call super class methods (including the constructor), however in Python 3 the process has been simplified:

  5. Get attribute from a super class in python - Stack Overflow

    May 28, 2015 · I have a base class, a bunch of subclasses, and for each of these subclasses, I have another set of sub-subclasses. For example: class BaseClass(object): def __init__(self): …

  6. How do I call a parent class's method from a child class in Python?

    When creating a simple object hierarchy in Python, I'd like to be able to invoke methods of the parent class from a derived class. In Perl and Java, there is a keyword for this (super). In Perl, I

  7. Python: How do I make a subclass from a superclass?

    Oct 22, 2009 · In Python, how do you make a subclass from a superclass?

  8. Getting all superclasses in Python 3 - Stack Overflow

    Jun 24, 2015 · How I can get a list with all superclasses of given class in Python? I know, there is a __subclasses__() method in inspent module for getting all subclasses, but I don't know any …

  9. python - Using super with a class method - Stack Overflow

    If we're using a class method, we don't have an instance to call super with. Fortunately for us, super works even with a type as the second argument. --- The type can be passed directly to …

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

    Nov 3, 2015 · Having answered the question of "What does super do in Python?", the next question is how to use it effectively. See this step-by-step tutorial or this 45 minute video.