]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-149044: Improve Py_tp_base[s] docs & error message for non-type bases (GH-151252)
authorPetr Viktorin <encukou@gmail.com>
Wed, 17 Jun 2026 13:27:02 +0000 (15:27 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Jun 2026 13:27:02 +0000 (15:27 +0200)
commit16185e9fe2037d2171626f79c3d099bd7772b53e
treea8195f6b53a09a27fdbd990d63e64fec05ead2eb
parent6b142ab9a0007d37c68c74f81e2c8638330003e2
gh-149044: Improve Py_tp_base[s] docs & error message for non-type bases (GH-151252)

The initial implementation of PEP 820 worsened the error message
when non-types are given as base types in Py_tp_bases & Py_tp_base.
Bring back the 'bases must be types' wording and add a 'got' note for
easier debugging.

Improve slot ID documentation, and soft-deprecate Py_tp_base
(as per the PEP).
Doc/c-api/type.rst
Doc/c-api/typeobj.rst
Doc/tools/removed-ids.txt
Doc/whatsnew/3.15.rst
Lib/test/test_capi/test_misc.py
Lib/test/test_capi/test_slots.py
Misc/NEWS.d/next/C_API/2026-06-10-15-22-44.gh-issue-149044.O7KEcs.rst [new file with mode: 0644]
Modules/_testlimitedcapi/slots.c
Objects/typeobject.c