Skip to content

Commit faa169a

Browse files
furkanondermerwok
andauthored
pythongh-66646: Explain __base__ attribute in the docs (pythonGH-102554)
Co-authored-by: Éric <[email protected]>
1 parent 5d0abb6 commit faa169a

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
@@ -1185,6 +1185,7 @@ Special attributes
11851185
single: __module__ (class attribute)
11861186
single: __dict__ (class attribute)
11871187
single: __bases__ (class attribute)
1188+
single: __base__ (class attribute)
11881189
single: __doc__ (class attribute)
11891190
single: __annotations__ (class attribute)
11901191
single: __annotate__ (class attribute)
@@ -1219,6 +1220,13 @@ Special attributes
12191220
In most cases, for a class defined as ``class X(A, B, C)``,
12201221
``X.__bases__`` will be exactly equal to ``(A, B, C)``.
12211222

1223+
* - .. attribute:: type.__base__
1224+
- .. impl-detail::
1225+
1226+
The single base class in the inheritance chain that is responsible
1227+
for the memory layout of instances. This attribute corresponds to
1228+
:c:member:`~PyTypeObject.tp_base` at the C level.
1229+
12221230
* - .. attribute:: type.__doc__
12231231
- The class's documentation string, or ``None`` if undefined.
12241232
Not inherited by subclasses.

0 commit comments

Comments
 (0)