This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Replace "method" with "attribute" in the description of super()
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: docs@python, eamanu, josh.r, maggyero, rhettinger, willingc
Priority: normal Keywords: patch

Created on 2019-09-23 07:04 by maggyero, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16331 closed maggyero, 2019-09-23 07:04
PR 16368 merged rhettinger, 2019-09-25 02:43
PR 16391 merged miss-islington, 2019-09-25 15:13
PR 16392 merged miss-islington, 2019-09-25 15:13
Messages (7)
msg352991 - (view) Author: Géry (maggyero) * Date: 2019-09-23 07:04
The description of `super()` uses the word "method" instead of the more general word "attribute".

> super([type[, object-or-type]])
> 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 been overridden in a class.

`super()` is not restricted to method access but can also do data attribute access:

```
>>> class A:
...     x = True
... 
>>> class B(A):
...     x = False
... 
>>> B().x
False
>>> super(B, B()).x
True
```

I have just opened a PR to address this issue.
msg353133 - (view) Author: Josh Rosenberg (josh.r) * (Python triager) Date: 2019-09-25 03:10
I prefer rhettinger's PR to your proposed PR; while super() may be useful for things other than methods, the 99% use case is methods, and deemphasizing that is a bad idea. rhettinger's PR adds a note about other use cases without interfering with super()'s primary use case.
msg353159 - (view) Author: Carol Willing (willingc) * (Python committer) Date: 2019-09-25 09:48
@maggyero Thanks for the PR and working to improve the docs.

For this particular issue, I prefer PR 16368 for its brevity and common use case. I'm recommending that it be merged.
msg353187 - (view) Author: Géry (maggyero) * Date: 2019-09-25 12:28
Alright, I am fine with @rhettinger's alternative PR too. I am closing this.
msg353212 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-09-25 15:13
New changeset 15ccc4fac09b866d61b069c6c136aabfe4bac09c by Raymond Hettinger in branch 'master':
bpo-38255: super() can search attributes as well as methods (GH-16368)
https://github.com/python/cpython/commit/15ccc4fac09b866d61b069c6c136aabfe4bac09c
msg353213 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-09-25 15:24
New changeset 7444a5a402bbac4268b95958a9578a9e3dae33e0 by Raymond Hettinger (Miss Islington (bot)) in branch '3.8':
bpo-38255: super() can search attributes as well as methods (GH-16368) (GH-16391)
https://github.com/python/cpython/commit/7444a5a402bbac4268b95958a9578a9e3dae33e0
msg353214 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-09-25 15:24
New changeset 3b5e9241142d6b7c22059115c0e68a8912753818 by Raymond Hettinger (Miss Islington (bot)) in branch '3.7':
bpo-38255: super() can search attributes as well as methods (GH-16368) (GH-16392)
https://github.com/python/cpython/commit/3b5e9241142d6b7c22059115c0e68a8912753818
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82436
2019-09-25 15:24:27rhettingersetmessages: + msg353214
2019-09-25 15:24:15rhettingersetmessages: + msg353213
2019-09-25 15:13:38miss-islingtonsetpull_requests: + pull_request15974
2019-09-25 15:13:37rhettingersetmessages: + msg353212
2019-09-25 15:13:31miss-islingtonsetpull_requests: + pull_request15973
2019-09-25 12:28:20maggyerosetstatus: open -> closed
resolution: fixed
messages: + msg353187

stage: patch review -> resolved
2019-09-25 09:48:27willingcsetnosy: + willingc
messages: + msg353159
2019-09-25 03:57:51eamanusetnosy: + eamanu
2019-09-25 03:10:01josh.rsetnosy: + josh.r
messages: + msg353133
2019-09-25 02:43:35rhettingersetkeywords: + patch
stage: patch review
pull_requests: + pull_request15948
2019-09-23 15:28:17rhettingersetassignee: docs@python -> rhettinger
2019-09-23 15:10:41fdrakesetversions: + Python 3.9
2019-09-23 14:59:17fdrakesetversions: + Python 3.8
2019-09-23 07:04:42maggyerocreate