← Quiz: Inheritance, ABC and MRO: all 10 questions
Quiz: Inheritance, ABC and MRO · Question 7 of 10
Why should classes in a diamond call super().method() instead of A.method(self)?
Why should classes in a diamond call super().method() instead of A.method(self)?
- A.super() is faster
- B.A.method(self) is not valid Python
- C.With super() every class runs once; calling A directly can make A run twice
- D.super() skips the grandparent
Answer & explanation
Correct answer: With super() every class runs once; calling A directly can make A run twice
The super() chain follows the MRO, where A appears only once.
Can you get the rest right without peeking?
Take the timed Quiz: Inheritance, ABC and MRO quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →