Skip to content

Conversation

@brianschubert
Copy link
Member

@brianschubert brianschubert commented Sep 2, 2025

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
@miss-islington-app
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
@bedevere-app
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 <[email protected]>
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 <[email protected]>
lkollar pushed a commit to lkollar/cpython that referenced this pull request Sep 9, 2025
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.

4 participants