Repository navigation
Conversation
Py_UNICODE was a typedef to wchar_t, deprecated by PEP 393 since Python 3.3 and at runtime since Python 3.13, and scheduled for removal in 3.16. Nothing in CPython used it: the Argument Clinic converter of the same name generates const wchar_t *, and the typedef is not part of the stable ABI. The documentation references to it are kept, with the link suppressed, as was done for PyWeakref_GetObject in pythonGH-133657.
Documentation build overview
403 files changed ·
|
vstinner
left a comment
There was a problem hiding this comment.
IMO PY_UNICODE_TYPE should also be removed in the same PR.
|
Why not keep both? Simple typedefs have virtually no maintenance cost. |
|
Removing |
|
I left |
That seems unlikely to me. What kinds of bugs is this likely to help discover? Removing |
|
@encukou: If we don't remove I searched for
Notes:
I didn't check if Details |
Yes, that's the current guidance in PEP-387:
|
|
An LLM check on the 29 projects:
Details
|
|
@fedonman: Can you update the PR to remove also PY_UNICODE_TYPE? |
|
Done, |
Py_UNICODEis a typedef towchar_t, deprecated by :pep:393since 3.3 and at runtime since 3.13, listed for removal in 3.16. This removes it, andPY_UNICODE_TYPE, the same typedef deprecated alongside it in 3.13.Nothing in CPython used either typedef. The Argument Clinic
Py_UNICODEconverter is unrelated: it generatesconst wchar_t *. Neither is in the stable ABI.Documentation references are kept with the link suppressed (
:c:type:!Py_UNICODE``), as GH-133657 did forPyWeakref_GetObject, and the anchor is recorded in `Doc/tools/removed-ids.txt`.This covers one of the three groups in gh-154757 and one box in gh-133644. The other two groups are not touched here: GH-136277 and GH-133654 are already open for them, and
Py_SetProgramNameandPySys_SetArgvwere reverted once before in gh-117987.Verified with a full build (
make -j),test_capiandtest_clinic(1986 tests, SUCCESS). A file usingPy_UNICODEorPY_UNICODE_TYPEnow fails to compile with "unknown type name", whilewchar_tstill works. Sphinx is not installed here, so the docs build is unverified locally.