-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-38294: Add list of no-longer-escaped chars to re.escape documentation #16442
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
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Prior to 3.7, re.escape escaped many characters that don't have special meaning in Python, but that use to require escaping in other tools and languages. This commit aims to make it clear which characters were, but are no longer escaped.
… isn't - escaped The current example shows escaping only of infix math operators. This example uses string.punctuation as input and doesn't change the order of the characters for the output.
This example illustrates two characters that changed behavior recently in addition to ".", which continues to be escaped.
Thanks @rbanffy for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
I'm having trouble backporting to |
Sorry, @rbanffy and @serhiy-storchaka, I could not cleanly backport this to |
Thanks @rbanffy for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry @rbanffy and @serhiy-storchaka, I had trouble checking out the |
…umentation. (pythonGH-16442) Prior to 3.7, re.escape escaped many characters that don't have special meaning in Python, but that use to require escaping in other tools and languages. This commit aims to make it clear which characters were, but are no longer escaped. (cherry picked from commit 15ae75d) Co-authored-by: Ricardo Bánffy <rbanffy@gmail.com>
Thanks @rbanffy for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
…tion. (pythonGH-16442) Prior to 3.7, re.escape escaped many characters that don't have special meaning in Python, but that use to require escaping in other tools and languages. This commit aims to make it clear which characters were, but are no longer escaped. (cherry picked from commit 15ae75d) Co-authored-by: Ricardo Bánffy <rbanffy@gmail.com>
GH-16626 is a backport of this pull request to the 3.8 branch. |
Thanks @rbanffy for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, @rbanffy and @serhiy-storchaka, I could not cleanly backport this to |
…tion. (GH-16442) Prior to 3.7, re.escape escaped many characters that don't have special meaning in Python, but that use to require escaping in other tools and languages. This commit aims to make it clear which characters were, but are no longer escaped. (cherry picked from commit 15ae75d) Co-authored-by: Ricardo Bánffy <rbanffy@gmail.com>
GH-16647 is a backport of this pull request to the 3.7 branch. |
…umentation. (GH-16442) (GH-16647) Prior to 3.7, re.escape escaped many characters that don't have special meaning in Python, but that use to require escaping in other tools and languages. This commit aims to make it clear which characters were, but are no longer escaped. (cherry picked from commit 15ae75d)
…umentation. (pythonGH-16442) (pythonGH-16647) Prior to 3.7, re.escape escaped many characters that don't have special meaning in Python, but that use to require escaping in other tools and languages. This commit aims to make it clear which characters were, but are no longer escaped. (cherry picked from commit 15ae75d)
…tion. (pythonGH-16442) Prior to 3.7, re.escape escaped many characters that don't have special meaning in Python, but that use to require escaping in other tools and languages. This commit aims to make it clear which characters were, but are no longer escaped.
The changes in behavior from 3.6 to 3.7 caused some minor issues with code that still needs to run on 2.7 while it is being migrated to 3.7.
Since "/" is usually a common delimiter for regexes, we assumed it'd be escaped, as it was up to 3.6, but since that's no longer the case, it'd be nice to emphasise the difference a little bit more than the current documentation does. As it is, it's easy to miss this specific character.
https://bugs.python.org/issue38294