Skip to content

Conversation

@davepeck
Copy link
Contributor

@davepeckdavepeck commented Jul 8, 2025

Per pending updates to PEP 750, we now provide an empty string default for Interpolation.expression.

If you're using t-string literals, Interpolation.expression is set to the original source text. But if you're writing code that creates Interpolation instances directly, there isn't always an obvious choice for expression.

@davepeckdavepeck marked this pull request as ready for review July 9, 2025 00:24
Copy link
Member

@lysnikolaoulysnikolaou left a comment

Choose a reason for hiding this comment

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

Let's add a test that checks that instantiating an Interpolation without an expression actually populates expression with the empty string and it's good to go!

@davepeck
Copy link
ContributorAuthor

davepeck commented Jul 9, 2025

Let's add a test that checks that instantiating an Interpolation without an expression actually populates expression with the empty string and it's good to go!

Sure; done!

Copy link
Member

@lysnikolaoulysnikolaou left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @davepeck!

@lysnikolaoulysnikolaou added the needs backport to 3.14 bugs and security fixes label Jul 10, 2025
@lysnikolaoulysnikolaou merged commit f1b8d01 into python:mainJul 10, 2025
46 checks passed
@miss-islington-app
Copy link

Thanks @davepeck for the PR, and @lysnikolaou 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 Jul 10, 2025
…ssion` (pythonGH-136441) (cherry picked from commit f1b8d01) Co-authored-by: Dave Peck <davepeck@gmail.com>
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.14 bugs and security fixes label Jul 10, 2025
lysnikolaou pushed a commit that referenced this pull request Jul 10, 2025
…ession` (GH-136441) (#136511) Co-authored-by: Dave Peck <davepeck@gmail.com>
AndPuQing pushed a commit to AndPuQing/cpython that referenced this pull request Jul 11, 2025
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
picnixz pushed a commit to picnixz/cpython that referenced this pull request Jul 13, 2025
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull request Sep 9, 2025
…n.expression` (pythonGH-136441) (python#136511) Co-authored-by: Dave Peck <davepeck@gmail.com>
Sign up for freeto 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.

2 participants

@davepeck@lysnikolaou