Title: ClassVar + Final · Issue #2371 · python/typing · GitHub
Open Graph Title: ClassVar + Final · Issue #2371 · python/typing
X Title: ClassVar + Final · Issue #2371 · python/typing
Description: In the spec, we say (qualifier.rst): In non-dataclasses, combining ClassVar and Final is redundant, and type checkers may choose to warn or error on the redundancy. But in the conformance suite we have: bad9: Final[ClassVar[int]] = 3 # E...
Open Graph Description: In the spec, we say (qualifier.rst): In non-dataclasses, combining ClassVar and Final is redundant, and type checkers may choose to warn or error on the redundancy. But in the conformance suite we ...
X Description: In the spec, we say (qualifier.rst): In non-dataclasses, combining ClassVar and Final is redundant, and type checkers may choose to warn or error on the redundancy. But in the conformance suite we ...
Opengraph URL: https://github.com/python/typing/issues/2371
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ClassVar + Final","articleBody":"In the spec, we say (qualifier.rst):\n\n> In non-dataclasses, combining ``ClassVar`` and ``Final`` is redundant, and type checkers may choose to warn or error on the redundancy.\n\nBut in the conformance suite we have:\n\n```python\nbad9: Final[ClassVar[int]] = 3 # E: ClassVar cannot be nested with Final\n```\n(classes_classvar.py)\n\nAnd:\n\n```python\n VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar\n VALUE3: Final[ClassVar] = 1 # E: Final cannot be used with ClassVar\n```\n(qualifiers_final_annotation.py)\n\nAt runtime, this was an error (if the annotation is evaluated) before 3.12, but it is allowed in 3.13+. We made this runtime change to allow usage in dataclasses.\n\nSo the spec makes this an optional error, but the conformance suite requires the error. Most type checkers currently do emit the error, but mypy when targeting 3.13+ allows the nesting (with some bugs: python/mypy#21906).\n\nI would propose to make the errors in the conformance suite optional to match the spec text, but I'd be open to other solutions too.","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2026-10-20T18:55:09Z","url":"https://github.com/python/typing/issues/2371"}
| 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:ff518c29-d59d-cfdf-c2b6-578315cf61fe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C3AA:2148FB:53D43C:71AED4:6AFF84ED |
| html-safe-nonce | 04c367d3452f46f101ab60d64afef6f68f3cbd1f9e63d134ca0a5198f6396394 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0FBOjIxNDhGQjo1M0Q0M0M6NzFBRUQ0OjZBRkY4NEVEIiwidmlzaXRvcl9pZCI6IjgxNTg4NTM0MDc4MDk5NjMyNDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a8915ac250bdcdf3f23932d98a9c06029237cc6c739729deefe70f10deb57615 |
| hovercard-subject-tag | issue:5947662596 |
| 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/typing/2371/issue_layout |
| twitter:image | https://opengraph.githubassets.com/476d27afb6f373f404f0dbc0321008ec733cdc73b916c8102bfedb4723ceff8c/python/typing/issues/2371 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/476d27afb6f373f404f0dbc0321008ec733cdc73b916c8102bfedb4723ceff8c/python/typing/issues/2371 |
| og:image:alt | In the spec, we say (qualifier.rst): In non-dataclasses, combining ClassVar and Final is redundant, and type checkers may choose to warn or error on the redundancy. But in the conformance suite we ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JelleZijlstra |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19488db4031f00b04ea79b4c70b5dd32cfa873a8d20b3877f3896b8e2d195946 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typing git https://github.com/python/typing.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 24604008 |
| octolytics-dimension-repository_nwo | python/typing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24604008 |
| octolytics-dimension-repository_network_root_nwo | python/typing |
| 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 | 7952f5285f4ba685d70c4c7540ad3cc9dc9746b8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width