Doubt about inheritance in Python

Asked

Viewed 28 times

2

Hi, I’m studying POO in Python and saw that you can inherit the attributes of a super class in two ways:

Class nome_da_classe(nome_da_superclasse):
    def __init__(self, args):
        super(nome_da_superclasse, self, args)

And also so:

Class nome_da_classe(nome_da_superclasse):
    def __init__(self, args):
        nome_da_superclasse.__init__(self, args)

The two ways do the same thing or is there any difference between them?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.