Repository navigation
Remove Py_UNICODE APIs except PEP 623 #85295
Description
Activity
# APIs relating to wstr
Since some APIs did not have Py_DEPRECATE until 3.9 (see #65140), it can not be removed in 3.10. I wrote PEP-623 for them.
This issue doesn't about them.
# Deprecated since Python 3.3, and not documented.
In Python 3.3 what's new:
- :c:macro:`Py_UNICODE_strlen`: use :c:func:`PyUnicode_GetLength` or
:c:macro:`PyUnicode_GET_LENGTH` - :c:macro:`Py_UNICODE_strcat`: use :c:func:`PyUnicode_CopyCharacters` or
:c:func:`PyUnicode_FromFormat` - :c:macro:`Py_UNICODE_strcpy`, :c:macro:`Py_UNICODE_strncpy`,
:c:macro:`Py_UNICODE_COPY`: use :c:func:`PyUnicode_CopyCharacters` or
:c:func:`PyUnicode_Substring` - :c:macro:`Py_UNICODE_strcmp`: use :c:func:`PyUnicode_Compare`
- :c:macro:`Py_UNICODE_strncmp`: use :c:func:`PyUnicode_Tailmatch`
- :c:macro:`Py_UNICODE_strchr`, :c:macro:`Py_UNICODE_strrchr`: use
:c:func:`PyUnicode_FindChar`
These functions are not documented. But they has Py_DEPRECATED(3.3) from Python 3.6.
Let's remove them in 3.10.# Deprecated since Python 3.3 with document
Some APIs has document with
.. deprecated:: 3.3 4.0.- PyLong_FromUnicode
- PyUnicode_TransformDecimalToASCII
- PyUnicode_AsUnicodeCopy
- PyUnicode_Encode
- PyUnicode_EncodeUTF7
- PyUnicode_EncodeUTF8
- PyUnicode_EncodeUTF16
- PyUnicode_EncodeUTF32
- PyUnicode_EncodeUnicodeEscape
- PyUnicode_EncodeRawUnicodeEscape
- PyUnicode_EncodeLatin1
- PyUnicode_EncodeASCII
- PyUnicode_EncodeCharmap
- PyUnicode_TranslateCharmap
- PyUnicode_EncodeMBCS
a) Can we replace 4.0 with 3.10 and remove them in 3.10?
b) Or should we replace 4.0 with 3.11 and wait one more year?- :c:macro:`Py_UNICODE_strlen`: use :c:func:`PyUnicode_GetLength` or
a) Can we replace 4.0 with 3.10 and remove them in 3.10?
b) Or should we replace 4.0 with 3.11 and wait one more year?I chose this because they are deprecated since 3.3, and Py_DEPRECATED is used since 3.6.
APIs have /* Py_DEPRECATED(3.3) */
-
PyUnicode_EncodeDecimal
It is used in PyLong_FromUnicode. Deprecate in 3.10 and remove in 3.12 -
PyUnicode_TransformDecimalToASCII
While PEP-393 deprecate this too, its document doesn't hasdeprecated. Deprecate in 3.10 and remove in 3.12 -
_PyUnicode_ToLowercase, _PyUnicode_ToUppercase
They are not deprecated by PEP-393, but bpo-12736. Deprecate in 3.10 and remove in 3.12.
On the other hand, _PyUnicode_ToTitlecase has Py_DEPRECATED. It can be removed in 3.10.
-
I confirmed PyUnicode_GetMax is not used in top4000 packages.
PyUnicode_AsUnicodeCopy is not used in top 4000 packages. Let's remove it too.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: