Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PEP 695] Generate error if new-style type alias used as base class #17789

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Sep 19, 2024

It doesn't work at runtime.

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
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.

None yet

3 participants