Title: stubtest invents _DT attribute on dataclasses · Issue #18811 · python/mypy · GitHub
Open Graph Title: stubtest invents _DT attribute on dataclasses · Issue #18811 · python/mypy
X Title: stubtest invents _DT attribute on dataclasses · Issue #18811 · python/mypy
Description: Bug Report Cf. python/typeshed#13645 and https://github.com/python/typeshed/actions/runs/13905970431/job/38908976156 When comparing dataclass with @dataclass(order=True) using stubtest, stubtest complains that X._DT is not present at run...
Open Graph Description: Bug Report Cf. python/typeshed#13645 and https://github.com/python/typeshed/actions/runs/13905970431/job/38908976156 When comparing dataclass with @dataclass(order=True) using stubtest, stubtest co...
X Description: Bug Report Cf. python/typeshed#13645 and https://github.com/python/typeshed/actions/runs/13905970431/job/38908976156 When comparing dataclass with @dataclass(order=True) using stubtest, stubtest co...
Opengraph URL: https://github.com/python/mypy/issues/18811
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stubtest invents _DT attribute on dataclasses","articleBody":"**Bug Report**\n\nCf. python/typeshed#13645 and https://github.com/python/typeshed/actions/runs/13905970431/job/38908976156\n\nWhen comparing dataclass with `@dataclass(order=True)` using stubtest, stubtest complains that `X._DT is not present at runtime` (where `X` is the dataclass).\n\nThis is probably due to synthesizing a TypeVar:\n\nhttps://github.com/python/mypy/blob/5c87e972d3c2c3c1f6229e1a655c4b903207dd32/mypy/plugins/dataclasses.py#L86\n\n(Thanks, @AlexWaygood.)\n\n**Your Environment**\n\n- Mypy version used: 1.15.0\n- Python version used: 3.12.9\n\nCommand run was:\n\n```\n/tmp/stubtest-1u57o6se/bin/pip install fpdf2[]==2.8.2 mypy==1.15.0 Pillow>=10.3.0 cryptography\nMYPYPATH=stubs/fpdf2 /tmp/stubtest-1u57o6se/bin/python -m mypy.stubtest --custom-typeshed-dir . fpdf --allowlist stubs/fpdf2/@tests/stubtest_allowlist.txt\n```","author":{"url":"https://github.com/srittau","@type":"Person","name":"srittau"},"datePublished":"2025-03-17T18:14:19Z","url":"https://github.com/python/mypy/issues/18811"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:b55ed4ab-6adb-2f71-be7b-c84355fe885d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB18:3CBF1A:226A009:2F25348:6B003432 |
| html-safe-nonce | c02120349fc288ed708f2c74b7d701ecfe92c04537d260e0eec346d7887ecb79 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjE4OjNDQkYxQToyMjZBMDA5OjJGMjUzNDg6NkIwMDM0MzIiLCJ2aXNpdG9yX2lkIjoiOTU3NzU5NzA0MzAwMjcwNjQyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d5d1b14bf8ea84a25cb44442af63ac0ea63e8141b6e1a6076c48e5260cae9682 |
| hovercard-subject-tag | issue:2925997450 |
| 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/mypy/18811/issue_layout |
| twitter:image | https://opengraph.githubassets.com/adebfa623dc3ddfed6e34d42021d4afb6c33ca23b7a478ac020ce532b2334c44/python/mypy/issues/18811 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/adebfa623dc3ddfed6e34d42021d4afb6c33ca23b7a478ac020ce532b2334c44/python/mypy/issues/18811 |
| og:image:alt | Bug Report Cf. python/typeshed#13645 and https://github.com/python/typeshed/actions/runs/13905970431/job/38908976156 When comparing dataclass with @dataclass(order=True) using stubtest, stubtest co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | srittau |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width