Skip to content

Use native parse_type_string() - #21965

Merged
ilevkivskyi merged 2 commits into
python:masterfrom
ilevkivskyi:use-parse-type
Sep 11, 2026
Merged

Use native parse_type_string()#21965
ilevkivskyi merged 2 commits into
python:masterfrom
ilevkivskyi:use-parse-type

Conversation

@ilevkivskyi

Copy link
Copy Markdown
Member

Fixes #21515

I also fix one remainder from Python 2 age where we accepted bytes literals as forward references.
cc @JukkaL

@ilevkivskyi

Copy link
Copy Markdown
Member Author

Btw note I am not touching parse_type_comment() in stubgenc.py yet. That one is a bit trickier, and will be probably better handled later by people more familiar with stubgen.

@github-actions

Copy link
Copy Markdown
Contributor

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

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess this was the last use case of the legacy parser when type checking while using the new parser, nice!

@ilevkivskyi
ilevkivskyi merged commit ab3849b into python:master Sep 11, 2026
25 checks passed
@ilevkivskyi
ilevkivskyi deleted the use-parse-type branch September 11, 2026 11:05
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.

We need equivalent of parse_type_string() in native parser

2 participants