◐ Shell
clean mode source ↗

fix: Python-Rust combining char diff in isalnum by joshuamegnauth54 · Pull Request #7612 · RustPython/RustPython

coderabbitai[bot]

Bot reviewed Apr 15, 2026

ShaharNaveh

ShaharNaveh

ShaharNaveh

Related to: RustPython#7518

Rust and Python differ on alphanumeric characters. Rust follows the
Unicode standard closer than Python. This means that is_alphanumeric
(char function in Rust) is different from isalnum (Python). To fix the
discrepancy, RustPython needs to mimic Python by rejecting certain
characters. Some classes of combining characters count as alphanumeric
in Rust but not Python. Combining characters are accent marks
that are combined with other characters to create a single grapheme.

It's possible that this PR is not exhaustive. I fixed the combining
character issue BUT I don't know the full range of discrepancies.

coderabbitai[bot]

ShaharNaveh

ShaharNaveh

youknowone