From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 21 Oct 2025 07:06:49 +0000 (+0200) Subject: [3.14] gh-66646: Explain __base__ attribute in the docs (GH-102554) (GH-140365) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4215f7f519cf75edc0ef5dcd803c24e7767a2a62;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-66646: Explain __base__ attribute in the docs (GH-102554) (GH-140365) (cherry picked from commit faa169afa0dad9586b294ea9ab6e5e17c5712861) Co-authored-by: Furkan Onder Co-authored-by: Éric --- diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index c37ed4695d0a..c176e7158e48 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1185,6 +1185,7 @@ Special attributes single: __module__ (class attribute) single: __dict__ (class attribute) single: __bases__ (class attribute) + single: __base__ (class attribute) single: __doc__ (class attribute) single: __annotations__ (class attribute) single: __annotate__ (class attribute) @@ -1219,6 +1220,13 @@ Special attributes In most cases, for a class defined as ``class X(A, B, C)``, ``X.__bases__`` will be exactly equal to ``(A, B, C)``. + * - .. attribute:: type.__base__ + - .. impl-detail:: + + The single base class in the inheritance chain that is responsible + for the memory layout of instances. This attribute corresponds to + :c:member:`~PyTypeObject.tp_base` at the C level. + * - .. attribute:: type.__doc__ - The class's documentation string, or ``None`` if undefined. Not inherited by subclasses.