All challenges
Multiple ChoiceIntermediate 30s

__eq__ and Equality

Choose the best answer for: equality in classes
Options
  1. 1== calls __hash__ to compare by computed hash
  2. 2Custom classes cannot define ==, only identity
  3. 3== always compares identity, ignoring __eq__
  4. 4__eq__ defines == comparison behavior

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle