-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-134158: Fix PyREPL coloring of double braces in f/t-strings #134159
Conversation
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Looking at the after it still does not seem correct, the fifth and sixth example should both have a white pair of braces. |
Why do you think so? They only contain literal braces, no interpolation delimiters. We could add a specific color for double-braces, to convey the meaning they are "special", like eg. VSCode default theme does: 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 |
Misc/NEWS.d/next/Core_and_Builtins/2025-05-17-20-44-51.gh-issue-134158.ewLNLp.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Peter Bierma <[email protected]>
Thanks @loic-simon for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…ythongh-134159) (cherry picked from commit 71ea6a6) Co-authored-by: Loïc Simon <[email protected]> Co-authored-by: Loïc Simon <[email protected]> Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
GH-134227 is a backport of this pull request to the 3.14 branch. |
…gh-134159) (#134227) Co-authored-by: Loïc Simon <[email protected]> Co-authored-by: Loïc Simon <[email protected]> Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
This PR add a special-case in
_pyrepl.utils.Span.from_token
to correctly color double braces in f-strings or t-strings.Before:
After: