Skip to content
Merged
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
df3297b
Explain __base__ attribute in the docs
furkanonder Mar 9, 2023
7997fc9
explain __base__ attribute in the stdtypes doc
furkanonder Mar 9, 2023
933f8f3
explain __base__ attribute in the datamodel doc
furkanonder Mar 9, 2023
53be240
Add note to the __base__ attribute explanation
furkanonder Mar 9, 2023
548abb8
fix doc tests
furkanonder Mar 9, 2023
90c3b74
Use right markup for CPython implementation
furkanonder Mar 13, 2023
6d1ad66
Use impl-detail:: markup instead of note::
furkanonder Mar 13, 2023
b676958
harmonize indentation
merwok May 11, 2023
68e557b
fix wording for CPython
furkanonder Jan 20, 2024
6b13541
resolve conflict
furkanonder Jan 20, 2024
01c2912
remove __base__ explaination in the object.rst and stdtypes.rst
furkanonder Jan 21, 2024
53bd224
remove __base__ explaination in the datamodel.rst
furkanonder Jan 21, 2024
dabe938
add __base__ explaination into Doc/c-api/object.rst
furkanonder Jan 21, 2024
1275b18
Merge branch 'python:main' into issue-66646
furkanonder Jan 21, 2024
f0fb022
Use :attr:`~class.__base__` instead of :attr:`__base__`
furkanonder Jan 22, 2024
0246fe2
Merge branch 'main' into issue-66646
furkanonder Aug 19, 2025
15b8649
Fix __base__ attribute references and description
furkanonder Aug 20, 2025
9e10d94
Simplify __base__ attribute explanation
furkanonder Aug 25, 2025
ed7169c
Document __base__ attribute in data model reference
furkanonder Sep 19, 2025
96381b4
Merge branch 'main' into issue-66646
furkanonder Sep 19, 2025
20a5da7
Document __base__ attribute with single impl-detail block
furkanonder Oct 15, 2025
71638d2
Merge branch 'main' into issue-66646
furkanonder Oct 15, 2025
ec6d7d3
Add blank line after documentation of __base__ attribute
furkanonder Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1219,6 +1220,16 @@ 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__
- The base class that determines the instance layout. This attribute
identifies the single base class in the inheritance chain that is
responsible for the memory layout of instances, corresponding to
:c:member:`~PyTypeObject.tp_base` at the C level.

.. impl-detail::
Note that behavior of the ``__base__`` attribute is dependent on the
:term:`CPython` implementation.

* - .. attribute:: type.__doc__
- The class's documentation string, or ``None`` if undefined.
Not inherited by subclasses.
Expand Down
Loading