← Quiz: Magic Methods and Properties: all 10 questions
Quiz: Magic Methods and Properties · Question 4 of 10
Without eq, what does a == b check for two objects of your class?
Without __eq__, what does a == b check for two objects of your class?
- A.Whether all attributes are equal
- B.Whether they have the same class
- C.Whether their str values match
- D.Whether they are the same object
Answer & explanation
Correct answer: Whether they are the same object
The default equality is identity.
Can you get the rest right without peeking?
Take the timed Quiz: Magic Methods and Properties quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →