Use icu4x for casefold()#7780
Conversation
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.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ShaharNaveh
left a comment
There was a problem hiding this comment.
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
|
Nope, 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 |
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.