2021年1月24日星期日

How to convert a unicode string to upper/lower/title case using Python's C API avoiding functions deprecated in Python 3.3?

As described in

https://docs.python.org/3/c-api/unicode.html#unicode-character-properties,

Py_UNICODE_TOUPPER and friends are deprecated since Python 3.3, when PEP 393 was implemented. However, there does not seem any replacement. In particular, the C API does not seem to allow calls to the underlying C functions of methods such as 'abc'.upper().

Does this mean that the C API, since Python 3.3, no longer supports these basic str conversions? Is there any workaround?

https://stackoverflow.com/questions/65876380/how-to-convert-a-unicode-string-to-upper-lower-title-case-using-pythons-c-api-a January 25, 2021 at 05:54AM

没有评论:

发表评论