René's URL Explorer Experiment


Title: fix: Handle char expansion in islower, isupper by joshuamegnauth54 · Pull Request #7583 · RustPython/RustPython · GitHub

Open Graph Title: fix: Handle char expansion in islower, isupper by joshuamegnauth54 · Pull Request #7583 · RustPython/RustPython

X Title: fix: Handle char expansion in islower, isupper by joshuamegnauth54 · Pull Request #7583 · RustPython/RustPython

Description: Closes: #7526 py_islower and py_isupper need to handle expansions for letter casing. Comparing chars directly can miss edge cases in certain languages. Unfortunately, like the last PR, this allocates to handle potential expansions. I also had to add icu_casemap as a dependency. RustPython is already using parts of icu4x so this doesn't add many transitive dependencies. I figured out how to do it without allocation after working on CodeRabbit's suggestions. I also added more tests based on CodeRabbit which all pass. I cross checked the tests with CPython too. 🥳 The ICU crates use the Writeable trait internally which allows writing to a buffer. If you want to avoid the heap allocations, I can try wrapping a stack allocated buffer that falls back to heap allocations in my next patch. icu_casemap also handles title casing. It may be useful to drop unicode-casing in favor of icu_casemap. icu4x is the official Unicode consortium implementation, so it's robust and will be maintained indefinitely. ^ I wrote this comment earlier when I added icu_casemap. I still think it's relevant so I'll leave it. Currently, there are still title case bugs that may be easier to fix using icu_casemap over unicode-casing. I'll tackle that in another patch. Summary by CodeRabbit Bug Fixes Improved Unicode case detection and classification so string case checks (isupper/islower/istitle) behave correctly for a wider range of international characters and mixed emoji/text sequences. Tests Expanded string tests to cover Unicode edge cases: modifier letters, title/swapcase behavior, emoji with text, and digit-only strings to ensure correct case-reporting.

Open Graph Description: Closes: #7526 py_islower and py_isupper need to handle expansions for letter casing. Comparing chars directly can miss edge cases in certain languages. Unfortunately, like the last PR, this allocat...

X Description: Closes: #7526 py_islower and py_isupper need to handle expansions for letter casing. Comparing chars directly can miss edge cases in certain languages. Unfortunately, like the last PR, this allocat...

Opengraph URL: https://github.com/RustPython/RustPython/pull/7583

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:01aee7b0-39ee-ac1f-649b-51a02205d052
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDC06:3609E5:2C01B50:3F85BA2:6A60D9ED
html-safe-nonce52153a6a808918b75c13ff69337227260b56a862ab956338c597f4a6fb7024b1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzA2OjM2MDlFNToyQzAxQjUwOjNGODVCQTI6NkE2MEQ5RUQiLCJ2aXNpdG9yX2lkIjoiMzIyNDA5NzEzMTg2ODUxMDcwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf549e0fa00debd4f398130d5d0b2737e09efde0a84fce50f5d824f2dd0bea8ec
hovercard-subject-tagpull_request:3520047168
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/7583/files
twitter:imagehttps://avatars.githubusercontent.com/u/48846352?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/48846352?s=400&v=4
og:image:altCloses: #7526 py_islower and py_isupper need to handle expansions for letter casing. Comparing chars directly can miss edge cases in certain languages. Unfortunately, like the last PR, this allocat...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None8302bdfafed4cf34ac9c1d3593108fafa53bc3f86b893907e38fa6bdd74361ac
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec3c2ff0c76b34772c83c9498a08cefee28f53da0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/7583/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F7583%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F7583%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/7583/files
Reloadhttps://github.com/RustPython/RustPython/pull/7583/files
Reloadhttps://github.com/RustPython/RustPython/pull/7583/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7583/files
RustPython https://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Notifications https://github.com/login?return_to=%2FRustPython%2FRustPython
Fork 1.5k https://github.com/login?return_to=%2FRustPython%2FRustPython
Star 22.2k https://github.com/login?return_to=%2FRustPython%2FRustPython
Code https://github.com/RustPython/RustPython
Issues 293 https://github.com/RustPython/RustPython/issues
Pull requests 102 https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality 0 https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
Code https://github.com/RustPython/RustPython
Issues https://github.com/RustPython/RustPython/issues
Pull requests https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
joshuamegnauth54:more-case-fixeshttps://github.com/joshuamegnauth54/RustPython/tree/more-case-fixes
Conversation 11 https://github.com/RustPython/RustPython/pull/7583
Commits 2 https://github.com/RustPython/RustPython/pull/7583/commits
Checks 19 https://github.com/RustPython/RustPython/pull/7583/checks
Files changed https://github.com/RustPython/RustPython/pull/7583/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7583/files
fix: Handle char expansion in islower, isupper https://github.com/RustPython/RustPython/pull/7583/files#top
Show all changes 2 commits https://github.com/RustPython/RustPython/pull/7583/files
44ef516 fix: Handle char expansion in islower, isupper joshuamegnauth54 Apr 12, 2026 https://github.com/RustPython/RustPython/pull/7583/commits/44ef5166c8c2c7ea6254c86051a1a99b919e5dca
712bd75 Ensure islower/isupper handles strs without chars joshuamegnauth54 Apr 13, 2026 https://github.com/RustPython/RustPython/pull/7583/commits/712bd75d7512e32da3f67b779f2a01eb014ff965
Clear filters https://github.com/RustPython/RustPython/pull/7583/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7583/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7583/files
Cargo.lock https://github.com/RustPython/RustPython/pull/7583/files#diff-13ee4b2252c9e516a0547f2891aa2105c3ca71c6d7a1e682c69be97998dfc87e
anystr.rs https://github.com/RustPython/RustPython/pull/7583/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
str.rs https://github.com/RustPython/RustPython/pull/7583/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
bytes_inner.rs https://github.com/RustPython/RustPython/pull/7583/files#diff-94a4e578864d9ec94d59e2b7f57ea8f5a67aa734d28847c8921202237f2156b7
builtin_str.py https://github.com/RustPython/RustPython/pull/7583/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
Cargo.lockhttps://github.com/RustPython/RustPython/pull/7583/files#diff-13ee4b2252c9e516a0547f2891aa2105c3ca71c6d7a1e682c69be97998dfc87e
View file https://github.com/joshuamegnauth54/RustPython/blob/712bd75d7512e32da3f67b779f2a01eb014ff965/Cargo.lock
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7583/files
crates/vm/src/anystr.rshttps://github.com/RustPython/RustPython/pull/7583/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
View file https://github.com/joshuamegnauth54/RustPython/blob/712bd75d7512e32da3f67b779f2a01eb014ff965/crates/vm/src/anystr.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7583/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7583/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
https://github.com/RustPython/RustPython/pull/7583/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
https://github.com/RustPython/RustPython/pull/7583/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
https://github.com/RustPython/RustPython/pull/7583/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
https://github.com/RustPython/RustPython/pull/7583/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
https://github.com/RustPython/RustPython/pull/7583/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
https://github.com/RustPython/RustPython/pull/7583/files#diff-dd35a1000e2e6c0e7e4310bf9339045337d1db8ef9795c3cd7f2dbbb8f3dd809
crates/vm/src/builtins/str.rshttps://github.com/RustPython/RustPython/pull/7583/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
View file https://github.com/joshuamegnauth54/RustPython/blob/712bd75d7512e32da3f67b779f2a01eb014ff965/crates/vm/src/builtins/str.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7583/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7583/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/7583/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/7583/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/7583/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/7583/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
https://github.com/RustPython/RustPython/pull/7583/files#diff-a04ea1f7734fe40189e756196e034e6dedfcd5c82f2925e58cfd51ba7432073a
crates/vm/src/bytes_inner.rshttps://github.com/RustPython/RustPython/pull/7583/files#diff-94a4e578864d9ec94d59e2b7f57ea8f5a67aa734d28847c8921202237f2156b7
View file https://github.com/joshuamegnauth54/RustPython/blob/712bd75d7512e32da3f67b779f2a01eb014ff965/crates/vm/src/bytes_inner.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7583/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7583/files#diff-94a4e578864d9ec94d59e2b7f57ea8f5a67aa734d28847c8921202237f2156b7
https://github.com/RustPython/RustPython/pull/7583/files#diff-94a4e578864d9ec94d59e2b7f57ea8f5a67aa734d28847c8921202237f2156b7
extra_tests/snippets/builtin_str.pyhttps://github.com/RustPython/RustPython/pull/7583/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
View file https://github.com/joshuamegnauth54/RustPython/blob/712bd75d7512e32da3f67b779f2a01eb014ff965/extra_tests/snippets/builtin_str.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7583/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7583/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
https://github.com/RustPython/RustPython/pull/7583/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
https://github.com/RustPython/RustPython/pull/7583/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
ShaharNavehhttps://github.com/ShaharNaveh
Apr 13, 2026https://github.com/RustPython/RustPython/pull/7583/files#r3076034716
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7583/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7583/files
https://github.com/RustPython/RustPython/pull/7583/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
https://github.com/RustPython/RustPython/pull/7583/files#diff-6f5712e86d81a34dbc4b8137f08f43eccb65ef4b7bd548bfd6de8cc723ce41e7
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7583/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.