Issue 32354: Unclear intention of deprecating Py_UNICODE_TOLOWER / Py_UNICODE_TOUPPER (original) (raw)

Issue32354

Created on 2017-12-18 02:00 by ideasman42, last changed 2022-04-11 14:58 by admin.

Messages (4)
msg308506 - (view) Author: Campbell Barton (ideasman42) * Date: 2017-12-18 02:00
Py_UNICODE_TOLOWER / Py_UNICODE_TOUPPER are marked as deprecated in the docs. https://docs.python.org/3/c-api/unicode.html?highlight=py_unicode_tolower#c.Py_UNICODE_TOLOWER Someone submitted a patch to our project which uses these. What is unclear, is if there is an intention to replace these (wrappers for '_PyUnicode_ToLowerFull' for eg). Or if this will be removed without any alternative. I assume the functionality will be kept somewhere since Python needs str.lower/upper. Will there be a way to perform this in the future? Either way, could docs be updated to reflect this?
msg308523 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-12-18 08:56
Py_UNICODE_TOLOWER / Py_UNICODE_TOUPPER *API* doesn't respect the latest Unicode standard. For example, it doesn't support this operation: >>> "ß".upper() 'SS'
msg308607 - (view) Author: Campbell Barton (ideasman42) * Date: 2017-12-19 02:11
Thanks for the info, in that case will there be a way to do this from the CPython API which can work with raw strings? (utf8, wchat_t or similar types), that doesn't require the GIL and alloc/free of PyObjects.
msg355480 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-10-27 16:17
See also bpo-38604: Schedule Py_UNICODE API removal.
History
Date User Action Args
2022-04-11 14:58:55 admin set github: 76535
2019-10-27 16:17:44 vstinner set messages: +
2017-12-19 02:11:01 ideasman42 set messages: +
2017-12-18 08:56:54 vstinner set messages: +
2017-12-18 02:00:12 ideasman42 create