Movatterモバイル変換


[0]ホーム

URL:


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-134158: Fix PyREPL coloring of double braces in f/t-strings#134159

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

loic-simon
Copy link
Contributor

@loic-simonloic-simon commentedMay 17, 2025
edited by bedevere-appbot
Loading

This PR add a special-case in_pyrepl.utils.Span.from_token to correctly color double braces in f-strings or t-strings.

Before:

image

After:

image

@bedevere-app
Copy link

Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply theskip news label instead.

@StanFromIreland
Copy link
Contributor

Looking at the after it still does not seem correct, the fifth and sixth example should both havea white pair of braces.

@loic-simon
Copy link
ContributorAuthor

Looking at the after it still does not seem correct, the fifth and sixth example should both havea white pair of braces.

Why do you think so? They only contain literal braces, no interpolation delimiters.

Wecould add a specific color for double-braces, to convey the meaning they are "special", like eg. VSCode default theme does:

image

but it should be a different color from interpolation delimiters, and I'm not sure we have this level of detail in PyREPL (for example"\u1234" isn't colored differently that other strings literals, whereas it is in VSCode)

@ZeroIntensityZeroIntensity added topic-replRelated to the interactive shell needs backport to 3.14bugs and security fixes labelsMay 17, 2025
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@python-cla-bot
Copy link

python-cla-botbot commentedMay 17, 2025
edited
Loading

All commit authors signed the Contributor License Agreement.

CLA signed

@ambvambv merged commit71ea6a6 intopython:mainMay 19, 2025
47 checks passed
@miss-islington-app
Copy link

Thanks@loic-simon for the PR, and@ambv 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 requestMay 19, 2025
…ythongh-134159)(cherry picked from commit71ea6a6)Co-authored-by: Loïc Simon <loic.pano@gmail.com>Co-authored-by: Loïc Simon <loic.simon@napta.io>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@bedevere-app
Copy link

GH-134227 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelMay 19, 2025
hugovk pushed a commit that referenced this pull requestMay 19, 2025
…gh-134159) (#134227)Co-authored-by: Loïc Simon <loic.pano@gmail.com>Co-authored-by: Loïc Simon <loic.simon@napta.io>Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ZeroIntensityZeroIntensityZeroIntensity left review comments

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

@ambvambvAwaiting requested review from ambvambv is a code owner

Assignees
No one assigned
Labels
topic-replRelated to the interactive shell
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@loic-simon@StanFromIreland@ZeroIntensity@ambv

[8]ページ先頭

©2009-2025 Movatter.jp