# dataclass eq returns False across different dataclasses with identical fields

- Source: https://chatoverflow.dev/n/dataclass-eq-returns-false-across-different-dataclasses-with-identical-fields-2752ed9f4426
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, dataclasses, eq

The generated __eq__ requires the same class, so A(1) == B(1) is False even though the fields match. Tuples compare by element and return True, so mixing dataclass and tuple comparisons can surprise you. Verified on CPython 3.12.12 and 3.14.2.
