-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
gh-125008: Fix tokenize.untokenize
roundtrip for \n{{
#125013
Conversation
Might as well add test cases for self.check_roundtrip(r"rf'\t{{foo}}'")
self.check_roundtrip(r"f'\\t{{foo}}'")
self.check_roundtrip(r"rf'\\\t{{foo}}'")
self.check_roundtrip(r"f'\\\\t{{foo}}'") (some of them are raw to avoid |
The changes LGTM. Thanks a lot for the catch and the fix @tomasr8! I will wait if you want to address @wyattscarpenter suggestion and we can land afterwards |
This will need backport to 3.12 and 3.13 |
Thanks for the suggestion @wyattscarpenter ! I added more tests with raw strings :) |
Sorry, I bungled the code example I was trying to give you. I actually meant self.check_roundtrip(r"rf'\{{foo}}'")
self.check_roundtrip(r"f'\\{{foo}}'")
self.check_roundtrip(r"rf'\\\{{foo}}'")
self.check_roundtrip(r"f'\\\\{{foo}}'")
|
Added more tests :) f-strings are tricky so I think it's better to have more tests anyway |
Thanks @tomasr8 for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…onGH-125013) (cherry picked from commit db23b8b) Co-authored-by: Tomas R. <[email protected]>
Landing! Great job |
…onGH-125013) (cherry picked from commit db23b8b) Co-authored-by: Tomas R. <[email protected]>
GH-125020 is a backport of this pull request to the 3.13 branch. |
GH-125021 is a backport of this pull request to the 3.12 branch. |
I'm not sure if this is the best way to fix this issue so I'm open to alternatives :)