Title: Dataclasses that inherit from other dataclasses fail type-checking when `explicit-override` is enabled · Issue #16452 · python/mypy · GitHub
Open Graph Title: Dataclasses that inherit from other dataclasses fail type-checking when `explicit-override` is enabled · Issue #16452 · python/mypy
X Title: Dataclasses that inherit from other dataclasses fail type-checking when `explicit-override` is enabled · Issue #16452 · python/mypy
Description: Bug Report Dataclasses that inherit from other dataclasses fail type-checking when explicit-override is enabled. This appears to be due to an unannotated override being constructed for the new & improved replace typing. To Reproduce from...
Open Graph Description: Bug Report Dataclasses that inherit from other dataclasses fail type-checking when explicit-override is enabled. This appears to be due to an unannotated override being constructed for the new & im...
X Description: Bug Report Dataclasses that inherit from other dataclasses fail type-checking when explicit-override is enabled. This appears to be due to an unannotated override being constructed for the new &...
Opengraph URL: https://github.com/python/mypy/issues/16452
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dataclasses that inherit from other dataclasses fail type-checking when `explicit-override` is enabled","articleBody":"**Bug Report**\r\n\r\nDataclasses that inherit from other dataclasses fail type-checking when `explicit-override` is enabled. This appears to be due to an unannotated override being constructed for the new & improved `replace` typing.\r\n\r\n**To Reproduce**\r\n\r\n```python\r\nfrom dataclasses import dataclass\r\n\r\n@dataclass\r\nclass Base:\r\n ...\r\n\r\n@dataclass\r\nclass Child(Base):\r\n ...\r\n```\r\n\r\n**Actual Behavior**\r\n\r\nmypy errors on `Child` with\r\n\r\n`Method \"__mypy-replace\" is not using @override but is overriding a method in class \"Base\" [explicit-override]`\r\n\r\n**Your Environment**\r\n\r\n- Mypy version used: 1.7.0\r\n- Mypy configuration options from `pyproject.toml`: \r\n```\r\nfollow_imports = \"silent\"\r\nwarn_redundant_casts = true\r\nwarn_unused_ignores = true\r\nwarn_unreachable = true\r\nwarn_return_any = true\r\nstrict_equality = true\r\ndisallow_untyped_defs = true\r\ndisallow_incomplete_defs = true\r\nenable_error_code = \"explicit-override\"\r\nnamespace_packages = false\r\n```\r\n- Python version used: 3.10.12","author":{"url":"https://github.com/adebrecht661","@type":"Person","name":"adebrecht661"},"datePublished":"2023-11-10T19:51:15Z","url":"https://github.com/python/mypy/issues/16452"}
| 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:5c3151af-e397-7117-ca57-357f1002bba7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B096:177D5B:2D95C9D:3C18BB6:6B001D7E |
| html-safe-nonce | 954bd8fd7c4dbe066e6ebf7d8facdcb3414f481aa3ae74bddac5f0c4af871f60 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDk2OjE3N0Q1QjoyRDk1QzlEOjNDMThCQjY6NkIwMDFEN0UiLCJ2aXNpdG9yX2lkIjoiNjc4OTM1MzQ1MjgzODMyOTcyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f9cf017ace11a7d079efd6a3d58ae9941ea4607e700ab76bc75bd5a3e7cb95ff |
| hovercard-subject-tag | issue:1988289357 |
| 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/16452/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d12485cca5eb2bdf196c6ec710425fd4f60acf091ea7b4a6eb1e742c7d2d9b70/python/mypy/issues/16452 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d12485cca5eb2bdf196c6ec710425fd4f60acf091ea7b4a6eb1e742c7d2d9b70/python/mypy/issues/16452 |
| og:image:alt | Bug Report Dataclasses that inherit from other dataclasses fail type-checking when explicit-override is enabled. This appears to be due to an unannotated override being constructed for the new & im... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adebrecht661 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width