FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-132661: Add default value (of `""`) for `Interpolation.expression` by davepeck · Pull Request #136441 · python/cpython · GitHub

/ cpython Public

gh-132661: Add default value (of "") for Interpolation.expression - #136441

Merged
lysnikolaou merged 9 commits into
python:mainfrom
t-strings:pep750-expression-default
Jul 10, 2025
Merged

gh-132661: Add default value (of "") for Interpolation.expression#136441
lysnikolaou merged 9 commits into
python:mainfrom
t-strings:pep750-expression-default

Conversation

davepeck commented Jul 8, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

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

lysnikolaou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 commented Jul 9, 2025
edited
Loading

Copy link
Copy Markdown
Contributor Author

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!

lysnikolaou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM! Thanks @davepeck!

lysnikolaou added the needs backport to 3.14 bugs and security fixes label Jul 10, 2025
lysnikolaou merged commit f1b8d01 into python:main Jul 10, 2025
42 checks passed

Copy link
Copy Markdown

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 Bot commented Jul 10, 2025

Copy link
Copy Markdown

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

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
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL