]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.15] gh-149044: Improve Py_tp_base[s] docs & error message for non-type bases ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 18 Jun 2026 08:17:15 +0000 (10:17 +0200)
committerGitHub <noreply@github.com>
Thu, 18 Jun 2026 08:17:15 +0000 (10:17 +0200)
commite9c7cc1f0b67a582cb44791d72ce0b858f937e0d
tree486039f5cb3d1a755091ad3103a6547b5a8e2a3d
parent8fe5897853b1f5d8b7a1dc9fc2b72c6244a74983
[3.15] gh-149044: Improve Py_tp_base[s] docs & error message for non-type bases (GH-151252) (GH-151606)

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).
(cherry picked from commit 16185e9fe2037d2171626f79c3d099bd7772b53e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
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