Skip to content

Use icu4x for casefold()#7780

Draft
joshuamegnauth54 wants to merge 1 commit intoRustPython:mainfrom
joshuamegnauth54:use-icu-for-casefold
Draft

Use icu4x for casefold()#7780
joshuamegnauth54 wants to merge 1 commit intoRustPython:mainfrom
joshuamegnauth54:use-icu-for-casefold

Conversation

@joshuamegnauth54
Copy link
Copy Markdown
Contributor

For ASCII, casefold() is equivalent to lower casing the string.

Casefolding is a Unicode operation defined by the standard. Both CPython and RustPython follow the standard without any frills. The icu4x set of crates implement casefold as per the standard, so RustPython can use the ICU crates instead of adding in a crate for one operation.

This also has the extra benefit of consistency - consistent Unicode version and consistent crate usage.

For ASCII, casefold() is equivalent to lower casing the string.

Casefolding is a Unicode operation defined by the standard. Both CPython
and RustPython follow the standard without any frills. The icu4x set of
crates implement casefold as per the standard, so RustPython can use
the ICU crates instead of adding in a crate for one operation.

This also has the extra benefit of consistency - consistent Unicode
version and consistent crate usage.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 9427b0af-93ac-4cb2-a994-2ece1bb2c114

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@ShaharNaveh ShaharNaveh left a comment

Choose a reason for hiding this comment

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

Thanks, like that a lot!
Do we have more places that uses caseless? maybe worth fixing them in a follow up PR and remove it a dependency if icu4x already providing that functionality

@joshuamegnauth54
Copy link
Copy Markdown
Contributor Author

Nope, caseless is used exactly once, so it's an easy win. 😁

The build is intentionally failing because I want to avoid a merge conflict on my end when I rebase on #7717. So after I rebase, I'll remove caseless and then force push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants