mirror of
https://github.com/python/cpython.git
synced 2025-08-10 20:08:47 +00:00
[3.12] gh-123207: Clarify the documentation for the mro lookup for super() (GH-123417) (#123733)
(cherry picked from commit 327463aef1
)
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
This commit is contained in:
parent
8eef5a80a4
commit
407505da8e
1 changed files with 4 additions and 4 deletions
|
@ -1885,10 +1885,10 @@ are always available. They are listed here in alphabetical order.
|
||||||
``D -> B -> C -> A -> object`` and the value of *type* is ``B``,
|
``D -> B -> C -> A -> object`` and the value of *type* is ``B``,
|
||||||
then :func:`super` searches ``C -> A -> object``.
|
then :func:`super` searches ``C -> A -> object``.
|
||||||
|
|
||||||
The :attr:`~class.__mro__` attribute of the *object_or_type* lists the method
|
The :attr:`~class.__mro__` attribute of the class corresponding to
|
||||||
resolution search order used by both :func:`getattr` and :func:`super`. The
|
*object_or_type* lists the method resolution search order used by both
|
||||||
attribute is dynamic and can change whenever the inheritance hierarchy is
|
:func:`getattr` and :func:`super`. The attribute is dynamic and can change
|
||||||
updated.
|
whenever the inheritance hierarchy is updated.
|
||||||
|
|
||||||
If the second argument is omitted, the super object returned is unbound. If
|
If the second argument is omitted, the super object returned is unbound. If
|
||||||
the second argument is an object, ``isinstance(obj, type)`` must be true. If
|
the second argument is an object, ``isinstance(obj, type)`` must be true. If
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue