You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is marked as "test needed" which the dev guide says "... reporter should post a script or instructions to let a triager or developer reproduce the issue."
Steps to re-create are to open an IDLE window and type in the code
While adding these, I noticed that IDLE was coloring now invalid ur prefixes and deleted those.
I decided to test by modifying the existing human visual htest.
Ammar: thank you for submitting a patch. It happens that I wrote my patch before I saw your submission. If I had seen yours first, I might have given you a chance to finish it. Feel free to try another IDLE issue.
Thank you for the new feature (I presume) and its application. I disliked both writing and reading all the near duplication. I am posting this to python-list as an example of what the new feature is good for.
Activity
KenzieTogami commentedon Dec 26, 2016
IDLE doesn't highlight f-strings like r-strings or u-strings. See the attached screenshot.
ammaraskar commentedon Dec 26, 2016
I've attached a patch that colorizes f-strings.
The issue is marked as "test needed" which the dev guide says "... reporter should post a script or instructions to let a triager or developer reproduce the issue."
Steps to re-create are to open an IDLE window and type in the code
and notice the colorization difference.
python-dev commentedon Dec 27, 2016
New changeset a48cc85e5706 by Terry Jan Reedy in branch '3.6':
Issue bpo-29071: IDLE now colors f-string prefixes (but not invalid ur prefixes).
https://hg.python.org/cpython/rev/a48cc85e5706
terryjreedy commentedon Dec 27, 2016
There are 10 possible f-string prefixes, including combinations with r/R. See
https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
While adding these, I noticed that IDLE was coloring now invalid ur prefixes and deleted those.
I decided to test by modifying the existing human visual htest.
Ammar: thank you for submitting a patch. It happens that I wrote my patch before I saw your submission. If I had seen yours first, I might have given you a chance to finish it. Feel free to try another IDLE issue.
ammaraskar commentedon Dec 27, 2016
Not a problem, thank you for the encouragement.
serhiy-storchaka commentedon Jan 1, 2017
The regular expression can be simplified using local flags:
+ stringprefix = r"(?i:\br|u|f|fr|rf|b|br|rb)?"
python-dev commentedon Jan 2, 2017
New changeset 62d3c0336df6 by Terry Jan Reedy in branch '3.6':
Issue bpo-29071: Use local flags for IDLE colorizer string prefix matcher.
https://hg.python.org/cpython/rev/62d3c0336df6
terryjreedy commentedon Jan 2, 2017
Thank you for the new feature (I presume) and its application. I disliked both writing and reading all the near duplication. I am posting this to python-list as an example of what the new feature is good for.
serhiy-storchaka commentedon Jan 2, 2017
Thank you for advertising the new feature. Would you like to improve the
documentation? It always was the hardest part to me.
terryjreedy commentedon Jan 2, 2017
The doc appears to be carefully accurate, but the second sentence especially is a bit awkward. I will open a new issue.
terryjreedy commentedon Apr 7, 2017
bpo-29287 is about syntax highlighting the code within f-strings as code rather than as part of the string.