Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-145241: specialize SyntaxError for single trailing-comma with item#145282

Merged
pablogsal merged 5 commits intopython:mainfrom
pablogsal:gh-145241-with-trailing-comma-news
Feb 28, 2026
Merged

gh-145241: specialize SyntaxError for single trailing-comma with item#145282
pablogsal merged 5 commits intopython:mainfrom
pablogsal:gh-145241-with-trailing-comma-news

Conversation

@pablogsal
Copy link
Member

@pablogsalpablogsal commentedFeb 26, 2026
edited by bedevere-appbot
Loading

@pablogsalpablogsalforce-pushed thegh-145241-with-trailing-comma-news branch from3433bc5 to4994e57CompareFebruary 26, 2026 21:46
Copy link
Member

@johnslavikjohnslavik left a comment
edited
Loading

Choose a reason for hiding this comment

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

Thanks! I've researched this a bit more, and I think we can make this even better :-)
Sorry for the resulting back-and-forth and not enough research in the issue.

The syntax error happens every time the lastwith item (could be one or could be multiple overall) has a bare trailing comma and items aren't parenthesized.

We'd want to add cases with multiple items as well and adapt the error message accordingly. I've added suggestions ready for you to apply. Please feel free to pick better phrasing though.

PS Also suggested usingRAISE_SYNTAX_ERROR_KNOWN_LOCATION so that the caret^ points at the faulty trailing comma (right now the caret points at the colon).

pablogsaland others added3 commitsFebruary 28, 2026 01:46
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
@pablogsalpablogsalenabled auto-merge (squash)February 28, 2026 01:47
…e-145241.hL2k9Q.rstCo-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
@pablogsalpablogsal merged commit09e8c38 intopython:mainFeb 28, 2026
47 checks passed
@pablogsalpablogsal deleted the gh-145241-with-trailing-comma-news branchFebruary 28, 2026 02:24
@johnslavikjohnslavik added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsFeb 28, 2026
@miss-islington-app
Copy link

Thanks@pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@miss-islington-app
Copy link

Thanks@pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@pablogsal, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 09e8c382312b145b710dca7072ff2e13fe8c09ab 3.13

@miss-islington-app
Copy link

Sorry,@pablogsal, I could not cleanly backport this to3.14 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 09e8c382312b145b710dca7072ff2e13fe8c09ab 3.14

@johnslavik
Copy link
Member

Uhh no, not worth it maybe.

@johnslavikjohnslavik removed needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsFeb 28, 2026
@johnslavik
Copy link
Member

johnslavik commentedFeb 28, 2026
edited
Loading

I've requested backports because#142236 (comment), but I'm giving up on that in this case. Too much effort.

bkap123 pushed a commit to bkap123/cpython that referenced this pull requestFeb 28, 2026
…h item (python#145282)Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@johnslavikjohnslavikjohnslavik approved these changes

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

Assignees

@pablogsalpablogsal

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@pablogsal@johnslavik

[8]ページ先頭

©2009-2026 Movatter.jp