-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-23674: Clarify ambiguities in super() docs #15564
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @rhettinger, finally you did it before me. Here are a few change suggestions.
Doc/library/functions.rst
Outdated
|
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The :attr:`~class.__mro__` attribute of the *type* lists the method |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly.
|
||
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 | ||
resolution search order used by both :func:`getattr` and :func:`super`. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolution search order used by both :func:`getattr` and :func:`super`. The | |
The :attr:`~class.__mro__` |
There was a problem hiding this comment.
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.
@rhettinger: Please replace |
Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
(cherry picked from commit cd81f05) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
GH-15585 is a backport of this pull request to the 3.8 branch. |
Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
(cherry picked from commit cd81f05) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
GH-15586 is a backport of this pull request to the 3.8 branch. |
https://bugs.python.org/issue23674