-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Improve performance of http.cookiejar.join_header_words
#128982
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
Labels
performance
Performance or resource usage
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
Comments
encukou
pushed a commit
that referenced
this issue
Feb 26, 2025
…er_words` for an efficient alternative (GH-128983) The function does not anymore rely on a regular expression to find alphanumeric characters and underscores.
Thank you! |
This is incorrect change. For example, it produces incorrect results for "foo;_" and "foo_bar". |
Oof, thanks for noticing. |
encukou
added a commit
to encukou/cpython
that referenced
this issue
Feb 26, 2025
…ejar.join_header_words` for an efficient alternative (pythonGH-128983)" This reverts commit 56e1900.
|
I'll close this one and we'll move to 130631 |
seehwan
pushed a commit
to seehwan/cpython
that referenced
this issue
Apr 16, 2025
…n_header_words` for an efficient alternative (pythonGH-128983) The function does not anymore rely on a regular expression to find alphanumeric characters and underscores.
seehwan
pushed a commit
to seehwan/cpython
that referenced
this issue
Apr 16, 2025
… in http.cookiejar.join_header_words for an efficient alternative (pythonGH-128983)" and add tests (pythonGH-130584) * Revert "pythongh-128982: Substitute regular expression in `http.cookiejar.join_header_words` for an efficient alternative (pythonGH-128983)" This reverts commit 56e1900. * Add tests
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
performance
Performance or resource usage
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
Uh oh!
There was an error while loading. Please reload this page.
Feature or enhancement
Proposal:
Currently, we use
if not re.search(r"^\w+$", v):
. This can be replaced byif not v.isalnum() and '_' not in v
. Benchmarks are as follows:It doesn't help having a compiled regex by the way.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
http.cookiejar.join_header_words
for an efficient alternative #128983The text was updated successfully, but these errors were encountered: