Issue 19067: Built-in range docstrings are not PEP-8 compatible (original) (raw)

Created on 2013-09-22 07:01 by marco.buttu, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
rangeobject.patch marco.buttu,2013-09-22 07:01 review
Messages (5)
msg198244 - (view) Author: Marco Buttu (marco.buttu) * Date: 2013-09-22 07:01
The range documentation is not PEP-8 compatible: >>> range.__doc__.splitlines()[-1] 'Returns a virtual sequence of numbers from start to stop by step.' >>> range.__reversed__.__doc__ 'Returns a reverse iterator.' >>> range.index.__doc__.splitlines()[-1] 'Raises ValueError if the value is not present.' They should have been 'Return...' and 'Raise...'. Patch is attached
msg198547 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2013-09-28 20:17
PEP8 just says "PEP 257 describes good docstring conventions." PEP 257 is what says '''It [the one line docstring] prescribes the function or method's effect as a command ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...". ''' I strongly prefer the rule, but we do not usually patch purely for PEP8 compliance. However, a docstring patch is safer than a code patch.
msg198549 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2013-09-28 20:37
I asked on py-dev whether to do this. #19068 and #19069 are similar issues for complex and float docstrings.
msg199005 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-05 21:40
New changeset 5135a431f7b3 by Ezio Melotti in branch '3.3': #19067: use imperative mood in range object docstrings. Patch by Marco Buttu. http://hg.python.org/cpython/rev/5135a431f7b3 New changeset b2c752eff474 by Ezio Melotti in branch 'default': #19067: merge with 3.3. http://hg.python.org/cpython/rev/b2c752eff474
msg199006 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-10-05 21:41
Fixed, thanks for the patch!
History
Date User Action Args
2022-04-11 14:57:51 admin set github: 63267
2013-10-05 21:41:27 ezio.melotti set status: open -> closedassignee: docs@python -> ezio.melottinosy: + ezio.melottimessages: + resolution: fixedstage: patch review -> resolved
2013-10-05 21:40:30 python-dev set nosy: + python-devmessages: +
2013-09-28 20:37:00 terry.reedy set messages: +
2013-09-28 20:17:15 terry.reedy set versions: - Python 3.1nosy: + terry.reedymessages: + stage: patch review
2013-09-28 04:38:03 rhettinger set priority: normal -> low
2013-09-28 03:46:35 tshepang set nosy: + tshepang
2013-09-22 07:01:15 marco.buttu create