Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

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

Merged
merged 1 commit into from
May 22, 2017

Conversation

ambv
Copy link
Contributor

@ambv ambv commented May 22, 2017

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

This partially solves bpo-23894.
(cherry picked from commit 0c4aca5)
@ambv 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 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"',):
Copy link
Member

@ericvsmith ericvsmith May 22, 2017

Choose a reason for hiding this comment

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

_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
Contributor Author

Choose a reason for hiding this comment

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

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 ambv merged commit 1398b1b into python:3.6 May 22, 2017
@ambv ambv deleted the backport-0c4aca5-3.6 branch July 12, 2021 11:21
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.