Skip to content
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

No conversion happens for raw (r) strings #167

Open
patrickdepinguin opened this issue Mar 8, 2023 · 1 comment
Open

No conversion happens for raw (r) strings #167

patrickdepinguin opened this issue Mar 8, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@patrickdepinguin
Copy link

Strings that have a 'r' (raw) prefix are not converted by flynt.

$ flynt -s "'foo {0} bar'.format(baz)"                                                                                                                              
f'foo {baz} bar'
$ flynt -s "r'foo {0} bar'.format(baz)"                                                                                                                                 
r'foo {0} bar'.format(baz)

$ flynt --version                                         
0.77

Expected conversion would have prefix rf or fr .

@ikamensh ikamensh added the bug Something isn't working label Apr 17, 2023
@wimglenn
Copy link

wimglenn commented Sep 20, 2024

I hit this one too. It's unfortunate for regex, which are almost always raw strings out of habit (even when they don't need to be), e.g.

import re
pat0 = re.compile(r".*")
pat1 = re.compile(r"foo/{}?".format(pat0))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants