Answer the question
In order to leave comments, you need to log in
Why is super used here if the class only inherits from object?
Why is super used here if the class is inherited from object?
Here is the code:
class Container(object):
def __init__(self):
super(Container, self).__init__()
Answer the question
In order to leave comments, you need to log in
Well, strictly speaking, there is no special need. This is done, for example, if in the future they are going to change the base class.
But if your __init__ is completely empty and there is nothing but super, then it is completely useless.
In the third python, by the way, this is already possible:
class Container():
def __init__(self):
super().__init__()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question