-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Open
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtopic-dataclassestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Semantics of dataclasses __eq__
have changed in Python 3.13+, the semantic is now inconsistent with the order=True
generated set of dunder methods on the same Python 3.13+ versions.
Related issues:
#128294
#120645
@dataclasses.dataclass(order=True)
class Data:
a: float
nan = float("nan")
assert not (Data(nan) < Data(nan))
# assert not (Data(nan) <= Data(nan)), "fails on 3.13 even though {<, ==} are both False"
assert not (Data(nan) > Data(nan))
# assert not (Data(nan) >= Data(nan)), "fails on 3.13 even though {>, ==} are both False"
assert (Data(nan) != Data(nan))
assert not (Data(nan) == Data(nan))
Proposed fix PR: #137497
CPython versions tested on:
3.13
Operating systems tested on:
Windows
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtopic-dataclassestype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error