gh-134158: Fix PyREPL coloring of double braces in f/t-strings#134159
gh-134158: Fix PyREPL coloring of double braces in f/t-strings#134159ambv merged 4 commits intopython:mainfrom
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 <zintensitydev@gmail.com>
|
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 <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 the 3.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>
…ythongh-134159) 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>
…ythongh-134159) 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>

This PR add a special-case in
_pyrepl.utils.Span.from_tokento correctly color double braces in f-strings or t-strings.Before:
After: