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
re.escape() does not work with bytes() #48006
Comments
In python 2, re.escape() works with either str or unicode, but in |
The attached "re_escape.py" is a (somewhat crappy) fix for re.escape() |
Mind adding a unittest? |
Will do, although I'm slightly concerned that my "bytes" version of the |
On further testing, sometimes the str version is faster, sometimes the |
I don't think there are cases where re.escape is performance critical - |
I don't think it's possible to say whether it's preformance critical - I tried building a version using regular expressions, but I couldn't do |
I meant "I can certainly imagine use cases..." In case it's not clear, I think the implementation in the patch is If someone can prove that re.escape() performance is causing problems |
Looks fine, except I used frozenset for the _alphanum* variables and |
All good. Thankyou. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: