The Python Oracle

What does 'super' do in Python? - difference between super().__init__() and explicit superclass __init__()

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game 5

--

Chapters
00:00 Question
00:46 Accepted answer (Score 352)
01:26 Answer 2 (Score 446)
08:27 Answer 3 (Score 58)
10:19 Answer 4 (Score 35)
10:44 Thank you

--

Full question
https://stackoverflow.com/questions/2228...

Answer 1 links:
[C3 linearization algorithm]: https://en.wikipedia.org/wiki/C3_lineari...

Answer 2 links:
[MRO]: https://stackoverflow.com/a/1848647
[C3 linearization example with super (a large hierarchy)]: https://stackoverflow.com/a/27670178
[Important behavior changes between old and new style classes]: https://stackoverflow.com/a/19950198/132...
[The Inside Story on New-Style Classes]: http://python-history.blogspot.com/2010/...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #oop #inheritance #multipleinheritance #super

#avk47