Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
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
gh-134158: Fix PyREPL coloring of double braces in f/t-strings#134159
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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 the |
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: 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 OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
python-cla-botbot commentedMay 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
71ea6a6
intopython:mainUh oh!
There was an error while loading.Please reload this page.
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 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>
GH-134227 is a backport of this pull request to the3.14 branch. |
…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>
Uh oh!
There was an error while loading.Please reload this page.
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: