Skip to content

Commit 7997fc9

Browse files
committed
explain __base__ attribute in the stdtypes doc
1 parent df3297b commit 7997fc9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Doc/library/stdtypes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5445,6 +5445,15 @@ types, where they are relevant. Some of these are not reported by the
54455445
The tuple of base classes of a class object.
54465446

54475447

5448+
.. attribute:: class.__base__
5449+
5450+
``__base__`` corresponds to the :c:member:`~PyTypeObject.tp_base` in a
5451+
type object. At the C level, Python has a single inheritance model
5452+
that determines the memory layout of instances. There is a chain
5453+
involving base classes that contribute to the instance layout.
5454+
``__base__`` is the base class that is involved in that chain.
5455+
5456+
54485457
.. attribute:: definition.__name__
54495458

54505459
The name of the class, function, method, descriptor, or

0 commit comments

Comments
 (0)