Skip to content

Commit 677a488

Browse files
miss-islingtonfurkanondermerwok
authored
[3.13] pythongh-66646: Explain __base__ attribute in the docs (pythonGH-102554) (pythonGH-140366)
(cherry picked from commit faa169a) Co-authored-by: Furkan Onder <[email protected]> Co-authored-by: Éric <[email protected]>
1 parent 9084371 commit 677a488

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Doc/reference/datamodel.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,7 @@ Special attributes
11581158
single: __module__ (class attribute)
11591159
single: __dict__ (class attribute)
11601160
single: __bases__ (class attribute)
1161+
single: __base__ (class attribute)
11611162
single: __doc__ (class attribute)
11621163
single: __annotations__ (class attribute)
11631164
single: __type_params__ (class attribute)
@@ -1191,6 +1192,13 @@ Special attributes
11911192
In most cases, for a class defined as ``class X(A, B, C)``,
11921193
``X.__bases__`` will be exactly equal to ``(A, B, C)``.
11931194

1195+
* - .. attribute:: type.__base__
1196+
- .. impl-detail::
1197+
1198+
The single base class in the inheritance chain that is responsible
1199+
for the memory layout of instances. This attribute corresponds to
1200+
:c:member:`~PyTypeObject.tp_base` at the C level.
1201+
11941202
* - .. attribute:: type.__doc__
11951203
- The class's documentation string, or ``None`` if undefined.
11961204
Not inherited by subclasses.

0 commit comments

Comments
 (0)