Skip to content

Conversation

@JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jun 3, 2024

Fix badly formed types that could be created when using aliases like type A = list.

Improve some error messages when using PEP 695 syntax.

Add a few PEP 695 tests.

Work on #15238.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2024

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

allow_placeholder=True,
declared_type_vars=type_params,
all_declared_type_params_names=all_type_params_names,
python_3_12_type_alias=True,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this always be True?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, since the visit_type_alias_stmt method is specific to the 3.12 type alias statement. Other type aliases are handled elsewhere. I implemented this separately to avoid making the existing type alias logic even more complicated, since this looks like the end-game type alias implementation.

@JukkaL JukkaL merged commit 93dac05 into master Jun 3, 2024
@JukkaL JukkaL deleted the type-var-syntax-5-misc branch June 3, 2024 16:10
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