KEMBAR78
[PEP 695] Generate error if new-style type alias used as base class by JukkaL · Pull Request #17789 · python/mypy · GitHub
Skip to content

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Sep 19, 2024

It doesn't work at runtime.

@github-actions
Copy link
Contributor

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

@JukkaL JukkaL merged commit 18fee78 into master Sep 20, 2024
19 checks passed
@JukkaL JukkaL deleted the alias-base-class branch September 20, 2024 11:49
@spt29
Copy link

spt29 commented Mar 18, 2025

Just out of curiosity: Why is this check necessary? I just came across it when trying to update old TypeAlias uses to the new type statement. With this restriction, the latter is not really a replacement for the former, and I can't immediately see a semantic reason for disallowing it, and I couldn't find something in the PEP about this, either.

(Related issue: The new type aliases are not callable, but the old ones were. This is useful when e.g. aliasing a NewType. So again, the new type aliases do not seem to be a full replacement for the old ones.)

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.

3 participants