mypy
e6d41eb6 - [mypyc] Add support for `str.lower()` and `str.upper()` (#20948)

Commit
117 days ago
[mypyc] Add support for `str.lower()` and `str.upper()` (#20948) Fixes https://github.com/mypyc/mypyc/issues/1088 Follow up on https://github.com/python/mypy/pull/19375 with full Unicode support: - ASCII fast path - Shared `CPyStr_ChangeCase` helper, parameterized by function pointers - **`_PyUnicode_ToLowerFull`/`_PyUnicode_ToUpperFull`** for Unicode which handle 1-to-N expansion (e.g., `ß`→`SS`); This was a sticky point with the previous PR which relied on `Py_UNICODE_TOLOWER`/`TOUPPER`. - Temporary `len * 3` UCS-4 buffer for the Unicode path; This is because each Unicode char may be expanded from 1 byte to 3
Author
Parents
Loading