Skip to content
Merged
Changes from 1 commit
Commits
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: 9 additions & 2 deletions Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1589,8 +1589,15 @@ are always available. They are listed here in alphabetical order.

Return a proxy object that delegates method calls to a parent or sibling
class of *type*. This is useful for accessing inherited methods that have
Comment thread
rhettinger marked this conversation as resolved.
Resolved
been overridden in a class. The search order is same as that used by
:func:`getattr` except that the *type* itself is skipped.
been overridden in a class.

The *object-or-type* determines the :term:`method resolution order`
to be searched. The search starts from the class right after the
*type*.

For example, if :attr:`~class.__mro__` of *object-or-type* is
``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 *type* lists the method

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The :attr:`~class.__mro__` attribute of the *type* lists the method

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should be object-or-type

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly.

resolution search order used by both :func:`getattr` and :func:`super`. The

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resolution search order used by both :func:`getattr` and :func:`super`. The
The :attr:`~class.__mro__`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the wording that references both getattr and super. Those two are deeply related.

Expand Down