Skip to content

Commit 01c2912

Browse files
committed
remove __base__ explaination in the object.rst and stdtypes.rst
1 parent 6b13541 commit 01c2912

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

Doc/c-api/object.rst

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -307,49 +307,6 @@ Object Protocol
307307
class, are considered classes. However, objects can override this by having
308308
a :attr:`~class.__bases__` attribute (which must be a tuple of base classes).
309309
310-
Another function, :attr:`__base__` that is specific to CPython and also
311-
exists in Jython and PyPy can also be used on a class inheriting from one
312-
or more classes. When such a class takes arguments in the correct order,
313-
then starting leftmost.
314-
315-
Let's look at the example cases;
316-
317-
>>> class A(object): pass
318-
...
319-
>>> class B(A): pass
320-
...
321-
>>> class C(int): pass
322-
...
323-
324-
The first user-defined class that either inherits from the instance
325-
of a built-in type other than object or inherits from another user
326-
defined class (single or multiple inheritance) that does so or in the
327-
absence of the above class.
328-
329-
>>> class D(B, A, C): pass
330-
...
331-
>>> D.__base__
332-
<class 'C'>
333-
>>>
334-
335-
A built-in type that is not an object or in the absence of the above class.
336-
337-
>>> class D(B, A, int): pass
338-
...
339-
>>> D.__base__
340-
<class 'int'>
341-
342-
The first user defined class that inherits either an object or
343-
derives from a class (directly or indirectly) that inherits an
344-
object is the value returned by the :attr:`__base__` function.
345-
346-
>>> class D(B, A): pass
347-
...
348-
>>> D.__base__
349-
<class 'B'>
350-
351-
.. impl-detail::
352-
Note that behavior of the ``__base__`` attribute is dependent on the :term:`CPython` implementation.
353310
354311
.. c:function:: int PyObject_IsInstance(PyObject *inst, PyObject *cls)
355312

Doc/library/stdtypes.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5492,17 +5492,6 @@ types, where they are relevant. Some of these are not reported by the
54925492
The tuple of base classes of a class object.
54935493

54945494

5495-
.. attribute:: class.__base__
5496-
5497-
``__base__`` corresponds to the :c:member:`~PyTypeObject.tp_base` in a
5498-
type object. At the C level, Python has a single inheritance model
5499-
that determines the memory layout of instances. There is a chain
5500-
involving base classes that contribute to the instance layout.
5501-
``__base__`` is the base class that is involved in that chain.
5502-
5503-
.. impl-detail::
5504-
The behavior of the ``__base__`` attribute is dependent on the :term:`CPython` implementation.
5505-
55065495
.. attribute:: definition.__name__
55075496

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

0 commit comments

Comments
 (0)