Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[mypyc] Implementstr.lower() andstr.upper() primitive#19375

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Jahongir-Qurbonov wants to merge10 commits intopython:master
base:master
Choose a base branch
Loading
fromJahongir-Qurbonov:str-lower-upper

Conversation

Jahongir-Qurbonov
Copy link
Contributor

Add primitive forstr.lower andstr.upper. Issue:mypyc/mypyc#1088

BobTheBuidler reacted with eyes emoji
@Jahongir-QurbonovJahongir-Qurbonov changed the titleAdd str.lower() and str.upper() primitives[mypyc] Implementstr.lower() andstr.upper() primitiveJul 4, 2025
@sterliakovsterliakov added the topic-mypycmypyc bugs labelJul 4, 2025
Copy link
Collaborator

@JukkaLJukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for the PR! Left some comments -- the semantics are pretty tricky, and we need to be careful to catch all special cases. I'd suggest running a test (doesn't need to be included in this PR necessarily) comparing upper/lower of all length-1 strings with Python semantics.

Jahongir-Qurbonov reacted with thumbs up emoji
assert "abc".lower() == "abc"
assert "AbC123".lower() == "abc123"
assert "áÉÍ".lower() == "áéí"
assert "😴🚀".lower() == "😴🚀"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Also test special cases (verify that this agrees with normal Python semantics):

  • 'SS'.lower() == 'ss'
  • 'Σ'.lower()
  • 'İ'.lower() (changes length!)

assert "ABC".upper() == "ABC"
assert "AbC123".upper() == "ABC123"
assert "áéí".upper() == "ÁÉÍ"
assert "😴🚀".upper() == "😴🚀"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Also test special case (verify that this agrees with normal Python semantics):

  • 'ß'.upper() == 'SS'
  • 'ffi'.upper() (length increases!)

@Jahongir-QurbonovJahongir-Qurbonov marked this pull request as draftJuly 4, 2025 18:08
Jahongir-Qurbonovand others added8 commitsJuly 6, 2025 16:42
…static lookup tables and using direct character conversion
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JukkaLJukkaLJukkaL left review comments

Assignees
No one assigned
Labels
topic-mypycmypyc bugs
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@Jahongir-Qurbonov@JukkaL@sterliakov

[8]ページ先頭

©2009-2025 Movatter.jp