I just learned about the inheritance in Python and how to use the super()
method, as I understand its syntax works like this:
class Parent_class:
def__init__(self, arg1, arg2):
self.arg1 = arg1
self.arg2 = arg2
class Subclass(Parent_class):
def__init__(self, arg1, arg2, new_arg):
super()__init__(arg1, arg2)
self.new_arg= new_arg
But I just read a code where it comes in different structure:
class Subclass(Parent_class):
def__init__(self, arg1, arg2, new_arg):
super(Subclass, self).__init__()
Are these 2 ways similar? If not what is the different? Thank you all