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-138372: Fix SyntaxWarning for erroneous t-string subscription #138375

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

Merged

Conversation

Copy link
Member

@brianschubert brianschubert commented Sep 2, 2025
edited by bedevere-app bot
Loading

Demonstration:

>>> [][t""]
<python-input-2>:1: SyntaxWarning: list indices must be integers or slices, not string.templatelib.Template; perhaps you missed a comma?
...
>>> t""[0]
<python-input-3>:1: SyntaxWarning: 'string.templatelib.Template' object is not subscriptable; perhaps you missed a comma?
...
>>> t""()
<python-input-4>:1: SyntaxWarning: 'string.templatelib.Template' object is not callable; perhaps you missed a comma?
...

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@lysnikolaou lysnikolaou left a comment

Choose a reason for hiding this comment

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

LGTM as well! Thanks @brianschubert!

@pablogsal pablogsal merged commit 5493b46 into python:main Sep 2, 2025
53 checks passed
Copy link

Thanks @brianschubert for the PR, and @pablogsal 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 Sep 2, 2025
pythonGH-138375)
(cherry picked from commit 5493b46)
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Copy link

bedevere-app bot commented Sep 2, 2025

GH-138392 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 Sep 2, 2025
pablogsal pushed a commit that referenced this pull request Sep 2, 2025
...on (GH-138375) (#138392)
gh-138372: Fix SyntaxWarning for erroneous t-string subscription (GH-138375)
(cherry picked from commit 5493b46)
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull request Sep 9, 2025
...cription (pythonGH-138375) (python#138392)
pythongh-138372: Fix SyntaxWarning for erroneous t-string subscription (pythonGH-138375)
(cherry picked from commit 5493b46)
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@vstinner vstinner vstinner approved these changes

@lysnikolaou lysnikolaou lysnikolaou approved these changes

@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

@iritkatriel iritkatriel Awaiting requested review from iritkatriel iritkatriel is a code owner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /