-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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-94808: Cover str.rsplit
for UCS1, UCS2 or UCS4
#98228
Conversation
Issue about |
@@ -445,10 +445,10 @@ def test_split(self): | |||
def test_rsplit(self): | |||
string_tests.CommonTest.test_rsplit(self) | |||
# test mixed kinds | |||
for left, right in ('ba', '\u0101\u0100', '\U00010301\U00010300'): | |||
for left, right in ('ba', 'юё', '\u0101\u0100', '\U00010301\U00010300'): |
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.
Does this cover all of the UCS-1, UCS-2, and UCS-4 branches? Might be worth commenting on which versions are covered by which characters.
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.
Other places don't have comments about it, so I didn't bother adding one as well.
I believe that this does cover all unicode kinds: ba', 'юё'
are UCS-1
, \u0101\u0100
is UCS-2
and \U00010301\U00010300
is UCS-4
Thanks @sobolevn for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-98291 is a backport of this pull request to the 3.11 branch. |
…8228) (cherry picked from commit b7dd2ca) Co-authored-by: Nikita Sobolev <[email protected]>
…#98291) gh-94808: Cover `str.rsplit` for UCS1, UCS2 or UCS4 (GH-98228) (cherry picked from commit b7dd2ca) Co-authored-by: Nikita Sobolev <[email protected]>
This code was not covered:
Now, it is!
@vstinner I got curious and looked into other
asciilib_*
calls. The setup is the same as in #98025 (comment)For example,
asciilib_rsplit_whitespace
also does not give any significant gain:./env/bin/python.exe -m pyperf timeit -v '"a b ca b d".rsplit()'
I will open a new issue about where we can discuss this!