Skip to content

Commit 53be240

Browse files
committed
Add note to the __base__ attribute explanation
1 parent 933f8f3 commit 53be240

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Doc/c-api/object.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ Object Protocol
286286
>>> D.__base__
287287
<class '__main__.B'>
288288
289+
Note that behavior of the ``__base__`` attribute is dependent on the CPython implementation.
290+
289291
.. c:function:: int PyObject_IsInstance(PyObject *inst, PyObject *cls)
290292
291293
Return ``1`` if *inst* is an instance of the class *cls* or a subclass of

Doc/library/stdtypes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5453,6 +5453,8 @@ types, where they are relevant. Some of these are not reported by the
54535453
involving base classes that contribute to the instance layout.
54545454
``__base__`` is the base class that is involved in that chain.
54555455

5456+
.. note::
5457+
The behavior of the ``__base__`` attribute is dependent on the CPython implementation.
54565458

54575459
.. attribute:: definition.__name__
54585460

Doc/reference/datamodel.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,9 @@ Custom classes
860860
involving base classes that contribute to the instance layout.
861861
``__base__`` is the base class that is involved in that chain.
862862

863+
.. note::
864+
The behavior of the ``__base__`` attribute is dependent on the CPython implementation.
865+
863866
:attr:`__doc__`
864867
The class's documentation string, or ``None`` if undefined.
865868

0 commit comments

Comments
 (0)