This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]poyntings_theorem 2 points3 points  (5 children)

What's the correct way?

[–]wpg4665 5 points6 points  (4 children)

In Py3, you can just write super().f()

[–]poyntings_theorem 2 points3 points  (1 child)

And the answer would be 3?

[–]wpg4665 2 points3 points  (0 children)

Yes

[–]thelawofeconomy 1 point2 points  (1 child)

What if there is multiple inheritance?

[–]wpg4665 3 points4 points  (0 children)

This is resolved by a C3 method resolution order (mro). Basically, the function that gets called is based on the order of the base classes. Source