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] Support Annotated[...] in new-style type aliases #17777

Merged
merged 2 commits into from
Sep 18, 2024

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Sep 17, 2024

The rvalue expression isn't semantically analyzed, so we can't rely on the fullname attribute to check if there is a reference to Annotated. Instead, use a lookup function provided by the caller to determine the fullname.

Error reporting in the second argument to Annotated is still inconsistent, but this seems lower priority. I'll create a follow-up issue about (or update an existing issue if one exists).

Fixes #17751.

The rvalue expression isn't semantically analyzed, so we can't rely
on the `fullname` attribute to check if there is a reference to
`Annotated`. Instead, use a lookup function provided by the caller
to determine the fullname.

Fixes #17751.

This comment has been minimized.

@JukkaL JukkaL merged commit a47f301 into master Sep 18, 2024
19 checks passed
@JukkaL JukkaL deleted the type-alias-annotated branch September 18, 2024 11:31
Copy link
Contributor

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

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.

type statement + Annotated == Invalid type alias
2 participants