Title: Inconsistent dataclass order behavior on Python 3.13+ · Issue #137658 · python/cpython · GitHub
Open Graph Title: Inconsistent dataclass order behavior on Python 3.13+ · Issue #137658 · python/cpython
X Title: Inconsistent dataclass order behavior on Python 3.13+ · Issue #137658 · python/cpython
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 #12...
Open Graph 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.1...
X 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.1...
Opengraph URL: https://github.com/python/cpython/issues/137658
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent dataclass order behavior on Python 3.13+","articleBody":"# Bug report\n\n### Bug description:\n\nSemantics 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.\n\nRelated issues:\n#128294\n#120645\n\n```python\n@dataclasses.dataclass(order=True)\nclass Data:\n a: float\n\nnan = float(\"nan\")\n\nassert not (Data(nan) \u003c Data(nan))\n# assert not (Data(nan) \u003c= Data(nan)), \"fails on 3.13 even though {\u003c, ==} are both False\"\nassert not (Data(nan) \u003e Data(nan))\n# assert not (Data(nan) \u003e= Data(nan)), \"fails on 3.13 even though {\u003e, ==} are both False\"\nassert (Data(nan) != Data(nan))\nassert not (Data(nan) == Data(nan))\n```\n\nProposed fix PR: #137497\n\n\n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nWindows\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-137497\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/gesslerpd","@type":"Person","name":"gesslerpd"},"datePublished":"2025-08-12T00:21:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/137658/cpython/issues/137658"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:3acd128f-aadb-c51f-1fb4-27af5a5fd98a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B000:148AF3:58E5D9:743739:696B45D5 |
| html-safe-nonce | 84c25374d24a6c55b1ff264202cd0942c7c21edc699208f017599df968ce8b2d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDAwOjE0OEFGMzo1OEU1RDk6NzQzNzM5OjY5NkI0NUQ1IiwidmlzaXRvcl9pZCI6IjYwODc5ODQ2MzE5NTAwMzQzODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 67c2c858261880f389c2d24d01998ee2ed5748a0293d60b2170becdc0f1ec2ae |
| hovercard-subject-tag | issue:3312033201 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/137658/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c21b969fb1c0a62d4930dfbd7bd6226282b32fba7e28e3292a66f6bdd0223bb1/python/cpython/issues/137658 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c21b969fb1c0a62d4930dfbd7bd6226282b32fba7e28e3292a66f6bdd0223bb1/python/cpython/issues/137658 |
| og:image:alt | 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.1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gesslerpd |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width