Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumPythondataclassesSingle-choice MCQ1 views

With `@dataclass(eq=False)`, how do equality and hashing behave for two instances with equal field values?

from dataclasses import dataclass @dataclass(eq=False) class P: x: int a = P(1) b = P(1) print(a == b, hash(a) == hash(a))