FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.6] bpo-23894: Make rb'' strings work in lib2to3 (GH-1724) by ambv · Pull Request #1730 · python/cpython · GitHub

/ cpython Public

[3.6] bpo-23894: Make rb'' strings work in lib2to3 (GH-1724) - #1730

Merged
ambv merged 1 commit into
python:3.6from
ambv:backport-0c4aca5-3.6
May 22, 2017
Merged

[3.6] bpo-23894: Make rb'' strings work in lib2to3 (GH-1724)#1730
ambv merged 1 commit into
python:3.6from
ambv:backport-0c4aca5-3.6

Conversation

ambv commented May 22, 2017

Copy link
Copy Markdown
Contributor

This partially solves bpo-23894.
(cherry picked from commit 0c4aca5)

This partially solves bpo-23894.
(cherry picked from commit 0c4aca5)
ambv changed the title [3.6] Make rb'' strings work in lib2to3 (GH-1724) [3.6] bpo-23894: Make rb'' strings work in lib2to3 (GH-1724) May 22, 2017
ambv requested a review from ericvsmith May 22, 2017 22:58
"bR'", 'bR"', "BR'", 'BR"', ):
"bR'", 'bR"', "BR'", 'BR"',
"rb'", 'rb"', "Rb'", 'Rb"',
"rB'", 'rB"', "RB'", 'RB"',):

ericvsmith May 22, 2017
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

_all_string_prefixes in Lib/tokenize.py computes similar prefixes (without ' or "), but generates it programatically. It's less error prone than listing these prefixes by hand. Plus, if "f" strings are added, the numbers go up dramatically.

You can't use it directly, because it doesn't support "ur" and variants, because they're not supported in 3.x. But maybe you can use a similar strategy.

This isn't a blocker.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I agree this is not elegant. Sadly, the list is not exhaustive as the _litprefix regex shows. So the algorithm would need to be custom anyway. I'd count this as a possible future improvement.

ambv merged commit 1398b1b into python:3.6 May 22, 2017
ambv deleted the backport-0c4aca5-3.6 branch July 12, 2021 11:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL