You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Disagreement with CPython about which unicode characters are alnum #7518
This says that it should match anything for which isalnum() is true. This turns out to be also an area where RustPython and CPython disagree. "\u0345".isalnum() returns False on CPython and True on RustPython.
I took a look into this issue. It turns out that Rust and Python disagree on alphanumeric characters. Rust strictly(?) uses the Unicode property for alphanumeric whereas Python considers visibility. So, \u{0345} is supposed to be combined with another character in order to be visible and therefore isn't considered alphanumeric by Python. Interestingly, Rust actually prints it whereas Python does not.
println!("\u{0345}");
print("\u0345")
^These differ!
Full disclosure, I'm not entirely sure if my research and tests are correct. This is just what I found so far. Seems like I'm on the right track, though. 😁 I'll try to fix this issue soon!
Activity
joshuamegnauth54 commentedon Apr 14, 2026
I took a look into this issue. It turns out that Rust and Python disagree on alphanumeric characters. Rust strictly(?) uses the Unicode property for alphanumeric whereas Python considers visibility. So,
\u{0345}is supposed to be combined with another character in order to be visible and therefore isn't considered alphanumeric by Python. Interestingly, Rust actually prints it whereas Python does not.^These differ!
Full disclosure, I'm not entirely sure if my research and tests are correct. This is just what I found so far. Seems like I'm on the right track, though. 😁 I'll try to fix this issue soon!
fix: Python-Rust combining char diff in isalnum
fix: Python-Rust combining char diff in isalnum
fix: Ignore combining characters in SRE
fix: Python-Rust combining char diff in isalnum
fix: Ignore combining characters in SRE
fix: Python-Rust combining char diff in isalnum (RustPython#7612)
fix: Python-Rust combining char diff in isalnum (#7612)