KEMBAR78
Disallow `ClassVar` in type aliases by brianschubert · Pull Request #19263 · python/mypy · GitHub
Skip to content

Conversation

brianschubert
Copy link
Member

Reject the following case from the conformance tests:

bad12: TypeAlias = ClassVar[str]  # E: ClassVar not allowed here

@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@hauntsaninja hauntsaninja merged commit fe91422 into python:master Jun 10, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants