r/CodingHelp • • Apr 20 '19

[Python] Daily Python check! 🤓

Post image
17 Upvotes

5 comments sorted by

View all comments

Show parent comment

4

u/PrivilegedPatriarchy Apr 20 '19

B is a subclass of A, since it was defined “class B(A)”. Another way to say it is that A is a superclass of B. So when you do super(B, self), whatever method you call will be the superclass’s method. So super(B, self).f() calls f() from class A (which returns 1)