Skip to content

gh-143517: Fix an edge case in rewriting stringified starred annotations#143518

Merged
JelleZijlstra merged 3 commits into
python:mainfrom
johnslavik:lstrip-starred-stringified-annotations
Jan 8, 2026
Merged

gh-143517: Fix an edge case in rewriting stringified starred annotations#143518
JelleZijlstra merged 3 commits into
python:mainfrom
johnslavik:lstrip-starred-stringified-annotations

Conversation

@johnslavik

@johnslavik johnslavik commented Jan 7, 2026

Copy link
Copy Markdown
Member

@johnslavik

Copy link
Copy Markdown
Member Author

(Ignore the name of 856f612, it's misleading)

@johnslavik johnslavik changed the title gh-143517: L-strip starred stringified annotations before checking for * gh-143517: Fix an edge case in rewriting stringified starred annotations Jan 7, 2026

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems simple enough :)

@JelleZijlstra JelleZijlstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure why anyone would do this, but we accept x: " int" and parse it into int, so I guess we should accept this too.

@JelleZijlstra JelleZijlstra merged commit 6c9f7b4 into python:main Jan 8, 2026
54 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @johnslavik for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 8, 2026
…notations (pythonGH-143518)

(cherry picked from commit 6c9f7b4)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
@bedevere-app

bedevere-app Bot commented Jan 8, 2026

Copy link
Copy Markdown

GH-143540 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jan 8, 2026
@johnslavik

Copy link
Copy Markdown
Member Author

Not sure why anyone would do this, but we accept x: " int" and parse it into int, so I guess we should accept this too.

I was mainly thinking that some automated code generation only could run into that.

JelleZijlstra pushed a commit that referenced this pull request Jan 8, 2026
…nnotations (GH-143518) (#143540)

gh-143517: Fix an edge case in rewriting stringified starred annotations (GH-143518)
(cherry picked from commit 6c9f7b4)

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
reidenong pushed a commit to reidenong/cpython that referenced this pull request Jan 12, 2026
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
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