python3 super fuction arguments | SoloLearn: Learn to code for FREE!

0

python3 super fuction arguments

hi i discover that the super funciton takes some optional argument but can someone explain to me what super function does if the areguments are exist ?

4/16/2021 12:56:06 AM

0MR4N

9 Answers

New Answer

+2

Or you can go to the genuine doco; always worth checking. It is possible for a class to inherit from multiple classes, and the optional arguments let you choose between them. https://docs.python.org/3/library/functions.html?highlight=super#super

+2

Here's a pretty good explanation of super() https://realpython.com/python-super/

+2

0MR4N , it doesn't always need to be self. If you are wanting to call a method from a parent class of one of your class' objects, you would specify that object instead of self. Another possibility is that you are importing a class from a library, and it has a private parent class that you don't want to import. If you wanted to access a class or static method from that private parent, you would put the class you have imported in that second argument, fitting the "or type" definition for the argument.

+1

0MR4N If you had thoroughly read the link I provided you'd have already known the answer. 😉

+1

ChaoticDawg yaaah i did 😆 but u knoooow i am hardhead

+1

why 10.1*6 = 60.599999999999994 10.1*3 = 30.299999999999997

0

Myk Dowling but sorry i knw now wht it does but what meas the second argumenet exactly and why it always need to be "self".

0

Myk Dowling ok thank u so much i understand now

-1

https://aramydesign.blogspot.com/?m=1