Skip to content

Conversation

davepeck
Copy link
Contributor

@davepeck davepeck 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.

@davepeck davepeck marked this pull request as ready for review July 9, 2025 00:24
@davepeck davepeck requested a review from lysnikolaou as a code owner July 9, 2025 00:24
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.

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
Contributor Author

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

@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! Thanks @davepeck!

@lysnikolaou lysnikolaou added the needs backport to 3.14 bugs and security fixes label Jul 10, 2025
@lysnikolaou lysnikolaou merged commit f1b8d01 into python:main Jul 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
@bedevere-app
Copy link

bedevere-app bot commented Jul 10, 2025

GH-136511 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 Jul 10, 2025
lysnikolaou pushed a commit that referenced this pull request Jul 10, 2025
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
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.

2 participants