Expand description
Unicode tables pinned to the oracle’s Python (3.11, Unicode 14.0), so the core’s string rules do not drift with Rust’s newer Unicode.
ND_ZEROS: the zero of every run of UnicodeNddigits. Python’sre\dandint()accept anyNddigit, soUnityVersion.from_strdoes (its port isversion/parse.rs; plan section 3.4).LOWER_EXCEPTIONS: code points whosestr.lower()under Unicode 14.0 differs from Rust’schar::to_lowercase, with Python’s result. Every other code point lowers as Rust lowers it (crate::pystr::py_lower, plan risk R7).SIGMA_CASEDandSIGMA_CASE_IGNORABLE: the two classes of code point that decide a capital sigma’s lower-case form under Unicode 14.0 (Final_Sigma: a cased character before it and none after it, skipping case-ignorable ones), read from Python 3.11’s ownstr.lower(). A case-ignorable character’s casedness is never read, so the cased table lists only cased characters that are not case-ignorable (crate::pystr::py_lower; D request 5).
Owner: package A. The tables are generated by tools/gen/gen_tables.py
in the oracle image (plan section 2.6), each under a header naming the
generator, its Python and, for LOWER_EXCEPTIONS, the rustc whose
char::to_lowercase it was compared with; gen_tables.py --check
regenerates and compares. A toolchain whose Unicode differs from that
rustc’s fails tests::the_exceptions_were_generated_for_this_toolchain,
so the table moves with the toolchain (plan risk R7).
Statics§
- LOWER_
EXCEPTIONS (code point, Python's lower-case string)pairs, sorted by code point.- ND_
ZEROS - The first code point of each
Ndrun (each run is ten digits, 0-9), sorted. - SIGMA_
CASED - Cased code points that are not case-ignorable, as inclusive ranges, sorted.
- SIGMA_
CASE_ IGNORABLE - Case-ignorable code points, as inclusive ranges, sorted.
Functions§
- is_
case_ ignorable - Whether
cis case-ignorable, as Python 3.11’s final-sigma context sees it. - is_
sigma_ cased - Whether
cis cased and not case-ignorable, as Python 3.11’s final-sigma context sees it. - lower_
exception - Python’s lower-case form of
cwhen it differs from Rust’s. - nd_
digit - The digit value of
cif it is a UnicodeNddigit (as Python 3.11 sees it).