Title: Extract shared `rustpython-unicode` crate and route core Unicode semantics through it by Copilot · Pull Request #7561 · RustPython/RustPython · GitHub
Open Graph Title: Extract shared `rustpython-unicode` crate and route core Unicode semantics through it by Copilot · Pull Request #7561 · RustPython/RustPython
X Title: Extract shared `rustpython-unicode` crate and route core Unicode semantics through it by Copilot · Pull Request #7561 · RustPython/RustPython
Description: This change introduces a shared rustpython-unicode crate to own CPython-aligned Unicode semantics and data access, instead of keeping that logic spread across str, regex, literal escaping, and unicodedata. The goal is to make Unicode behavior reusable across RustPython components while preserving higher-level string behavior in existing runtime crates. New shared Unicode crate Adds crates/unicode with low-level, reusable APIs for: character classification identifier predicates regex Unicode predicates case mapping / casefold helpers normalization unicodedata-style database lookups Keeps the API codepoint-oriented where needed and compatible with no_std consumers. Refactor core runtime call sites rustpython-vm now uses rustpython-unicode for: str.isdecimal() str.isspace() str.isprintable() str.isidentifier() WTF-8 lowercase / uppercase / casefold helpers rustpython-literal now uses the shared printable classification for repr/escape behavior. rustpython-sre_engine now routes its Unicode character-class and case helpers through the shared crate. Thin unicodedata integration crates/stdlib/src/unicodedata.rs now delegates reusable Unicode database and normalization operations to rustpython-unicode. This keeps module behavior in place while moving the underlying data/semantics into the shared layer. Focused coverage Adds unit coverage in rustpython-unicode for classification, identifiers, regex predicates, case mapping, normalization, and Unicode database access. Adds a RustPython snippet covering integration across str, re, and unicodedata. Example of the new shared API shape: use rustpython_unicode::{classify, identifier, normalize::NormalizeForm, normalize}; assert!(classify::is_decimal('५' as u32)); assert!(identifier::is_python_identifier("유니코드")); let text = rustpython_wtf8::Wtf8Buf::from("e\u{301}"); let normalized = normalize::normalize(NormalizeForm::Nfc, &text); assert_eq!(normalized, rustpython_wtf8::Wtf8Buf::from("é"));
Open Graph Description: This change introduces a shared rustpython-unicode crate to own CPython-aligned Unicode semantics and data access, instead of keeping that logic spread across str, regex, literal escaping, and unic...
X Description: This change introduces a shared rustpython-unicode crate to own CPython-aligned Unicode semantics and data access, instead of keeping that logic spread across str, regex, literal escaping, and unic...
Opengraph URL: https://github.com/RustPython/RustPython/pull/7561
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:1416754e-7829-8128-ee80-3c489f166b4d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EDDC:903F6:10DD3CB:1791BC5:6A61BA87 |
| html-safe-nonce | a797e0b3e71b8668258fa4cad15ab851654c80dba13a48cb2a716a6dec927d0d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRERDOjkwM0Y2OjEwREQzQ0I6MTc5MUJDNTo2QTYxQkE4NyIsInZpc2l0b3JfaWQiOiIyOTQ0NjU0NzM5ODQwODA5NjA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 60d03766070f5ec56c33b775ffb5b6bceeb7f14238a544b9fe344e4eeb1f40f8 |
| hovercard-subject-tag | pull_request:3490037811 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/7561/files |
| twitter:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| og:image:alt | This change introduces a shared rustpython-unicode crate to own CPython-aligned Unicode semantics and data access, instead of keeping that logic spread across str, regex, literal escaping, and unic... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6f4633bcf01c1ad14b73fd07dd39ac31d61f3d3c2578ee08ec1792b7b351eeb9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac296ae7f21856f1f92adbad22f870b6fbb4b907 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width