1

EX:

class Parent:

    def name(self):
        print("This is the parent method name()")


class Child(Parent):

    def name(self):
        super(Child, self).name()
        super().name()


dad = Parent()
son = Child()

dad.name()
son.name()


Output:
This is the parent method name()
This is the parent method name()
This is the parent method name()

I am confused as to why this works correctly in both cases, and I would like to know when I would have to use the super(Child, self).name() form in my code. Any help is greatly appreciated!

  • It has been made easier in python 3 as you don't need to insert any arguments for the super(). [Try reading this thread.](https://stackoverflow.com/questions/17509846/python-super-arguments-why-not-superobj) – Saket Khandelwal Sep 17 '18 at 03:51
  • That thread really helped. Don't know why I couldn't find it before. Thank you! –  Sep 17 '18 at 03:55

0 Answers0