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
bpo-44987: Speed up unicode normalization of ASCII strings #28283
Conversation
|
Doc/whatsnew/3.11.rst
Outdated
unicodedata | ||
----------- | ||
* If the given string is pure ASCII string, :func:`unicode.normalize` now | ||
handles this as an already normalized to process it in constant time. | ||
(Contributed by Dong-hee Na in :issue:`bpo-44987`.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not worth a new subsection in the "Improved Modules" section. An entry in the "Optimizations" section should be enough. And make it shorter. E.g. "Pure ASCII strings are now normalized in constant time."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :) Nice suggestion
@@ -0,0 +1,3 @@ | |||
If the given string is pure ASCII string, :func:`unicode.normalize` now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unicodedata
Nice optimization, thanks @corona10! By the way, I'm not sure why ".pdbrc is now read with utf-8 encoding." is mentioned in the Optimization section. |
I created PR #28518 for that. |
https://bugs.python.org/issue44987