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: doc Improve wording on classmethod/staticmethod
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: adelfino, cheryl.sabella, docs@python, miss-islington
Priority: normal Keywords: patch

Created on 2018-07-10 16:33 by adelfino, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8228 merged adelfino, 2018-07-10 16:35
PR 12544 merged miss-islington, 2019-03-25 22:53
PR 12545 merged miss-islington, 2019-03-25 22:54
Messages (5)
msg321390 - (view) Author: Andrés Delfino (adelfino) * (Python triager) Date: 2018-07-10 16:33
1. The classmethod definition reads:

"""
The @classmethod form is a function decorator – see the description of function definitions in Function definitions for details.

It can be called either on the class (such as C.f()) or on an instance (such as C().f())
"""

The second paragraph seems like talking about the classmethod function instead of a class method. The same goes for staticmethod.

2. The staticmethod definition reads:

"""
It can be called either on the class (such as C.f()) or on an instance (such as C().f()). The instance is ignored except for its class.
"""

"The instance is ignored except for its class." seems to have been copied from classmethod definition.

3. There is redundant text:

"see the description of function definitions in Function definitions"

"consult the documentation on the standard type hierarchy in The standard type hierarchy"

PR fixes this.
msg338834 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-03-25 22:53
New changeset 548cb6060ab9d5a66931ea2be4da08c2c72c9176 by Cheryl Sabella (Andre Delfino) in branch 'master':
bpo-34085: Improve wording on classmethod/staticmethod (#8228)
https://github.com/python/cpython/commit/548cb6060ab9d5a66931ea2be4da08c2c72c9176
msg338835 - (view) Author: miss-islington (miss-islington) Date: 2019-03-25 22:58
New changeset bd96393cda54044d81054225dcfc1b26374589a8 by Miss Islington (bot) in branch '2.7':
bpo-34085: Improve wording on classmethod/staticmethod (GH-8228)
https://github.com/python/cpython/commit/bd96393cda54044d81054225dcfc1b26374589a8
msg338836 - (view) Author: miss-islington (miss-islington) Date: 2019-03-25 23:00
New changeset b23b08623a46cef841038ee32948020692ef1b35 by Miss Islington (bot) in branch '3.7':
bpo-34085: Improve wording on classmethod/staticmethod (GH-8228)
https://github.com/python/cpython/commit/b23b08623a46cef841038ee32948020692ef1b35
msg338838 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-03-25 23:23
Thanks for the report and the PR, Andrés!
History
Date User Action Args
2022-04-11 14:59:03adminsetgithub: 78266
2019-03-25 23:23:44cheryl.sabellasetversions: - Python 3.6
2019-03-25 23:23:35cheryl.sabellasetstatus: open -> closed
resolution: fixed
messages: + msg338838

stage: patch review -> resolved
2019-03-25 23:00:05miss-islingtonsetmessages: + msg338836
2019-03-25 22:58:43miss-islingtonsetnosy: + miss-islington
messages: + msg338835
2019-03-25 22:54:06miss-islingtonsetpull_requests: + pull_request12494
2019-03-25 22:53:56miss-islingtonsetpull_requests: + pull_request12493
2019-03-25 22:53:46cheryl.sabellasetnosy: + cheryl.sabella
messages: + msg338834
2018-07-10 16:35:14adelfinosetkeywords: + patch
stage: patch review
pull_requests: + pull_request7766
2018-07-10 16:33:43adelfinocreate