From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:44:54 +0000 (+0200) Subject: [3.12] gh-123207: Clarify the documentation for the mro lookup for super() (GH-123417... X-Git-Tag: v3.12.6~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=407505da8ea46e21b53fcffe6a7edb0580b6902c;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-123207: Clarify the documentation for the mro lookup for super() (GH-123417) (#123733) (cherry picked from commit 327463aef173a1cb9659bccbecfff4530bbe6bbf) Co-authored-by: Pieter Eendebak --- diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index f4fca35944c1..51b6a2f29418 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -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``, then :func:`super` searches ``C -> A -> object``. - The :attr:`~class.__mro__` attribute of the *object_or_type* lists the method - resolution search order used by both :func:`getattr` and :func:`super`. The - attribute is dynamic and can change whenever the inheritance hierarchy is - updated. + The :attr:`~class.__mro__` attribute of the class corresponding to + *object_or_type* lists the method resolution search order used by both + :func:`getattr` and :func:`super`. The attribute is dynamic and can change + whenever the inheritance hierarchy is updated. 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