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: Docstring error in divmod function
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: abarry, docs@python, eric.smith, lemburg, mark.dickinson, mbarao, python-dev, stutzbach, zach.ware
Priority: normal Keywords:

Created on 2016-04-28 16:08 by mbarao, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (9)
msg264434 - (view) Author: (mbarao) Date: 2016-04-28 16:08
The documentation of the divmod function says that a tuple ((x-x%y)/y, x%y) is returned, but this is not correct anymore for python3.
I think it should be ((x-x%y)//y, x%y) where an integer division is used.
msg264435 - (view) Author: Anilyka Barry (abarry) * (Python triager) Date: 2016-04-28 16:31
The documentation looks fine to me. Are you seeing any other place that I'm missing?

https://docs.python.org/3/library/functions.html#divmod
msg264437 - (view) Author: (mbarao) Date: 2016-04-28 16:56
See divmod.__doc__
msg264440 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2016-04-28 19:10
> I think it should be ((x-x%y)//y, x%y) where an integer division is used.

How about simply (x//y, x%y)?
msg264441 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-28 19:26
New changeset fb49082a75d1 by Zachary Ware in branch '2.7':
Issue #26874: Make divmod docstring and full doc match
https://hg.python.org/cpython/rev/fb49082a75d1

New changeset ef193be5c3cd by Zachary Ware in branch '3.5':
Issue #26874: Fix divmod docstring
https://hg.python.org/cpython/rev/ef193be5c3cd

New changeset 28c89ebd6e5a by Zachary Ware in branch 'default':
Closes #26874: Merge with 3.5
https://hg.python.org/cpython/rev/28c89ebd6e5a
msg264442 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-04-28 19:28
If only I had reloaded the page before pushing...

Btw, this was first reported in issue1209411, but only the docs were changed, not the docstring.
msg264443 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-28 19:40
New changeset 5a578ec4b3b3 by Zachary Ware in branch '2.7':
Issue #26874: Simplify the divmod docstring.
https://hg.python.org/cpython/rev/5a578ec4b3b3

New changeset 3edf8aa1ed97 by Zachary Ware in branch '3.5':
Issue #26874: Simplify the divmod docstring
https://hg.python.org/cpython/rev/3edf8aa1ed97

New changeset c6e285789963 by Zachary Ware in branch 'default':
Closes #26874: Merge with 3.5
https://hg.python.org/cpython/rev/c6e285789963
msg264601 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-05-01 17:34
New changeset 84ff79cce41e by Serhiy Storchaka in branch '3.5':
Regenerate Argument Clinic code for issue #26874.
https://hg.python.org/cpython/rev/84ff79cce41e

New changeset 98678738b7e9 by Serhiy Storchaka in branch 'default':
Regenerate Argument Clinic code for issue #26874.
https://hg.python.org/cpython/rev/98678738b7e9
msg264607 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-05-01 19:33
Forgot that step, thanks Serhiy!
History
Date User Action Args
2022-04-11 14:58:30adminsetgithub: 71061
2016-05-01 19:33:26zach.waresetmessages: + msg264607
2016-05-01 17:34:25python-devsetmessages: + msg264601
2016-04-28 19:40:47python-devsetstatus: open -> closed
resolution: fixed
messages: + msg264443

stage: resolved
2016-04-28 19:28:45zach.waresetstatus: closed -> open

nosy: + zach.ware
messages: + msg264442

resolution: fixed -> (no value)
stage: resolved -> (no value)
2016-04-28 19:26:39python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg264441

resolution: fixed
stage: resolved
2016-04-28 19:10:40mark.dickinsonsetmessages: + msg264440
2016-04-28 18:01:37serhiy.storchakasetnosy: + lemburg, mark.dickinson, eric.smith, stutzbach
2016-04-28 16:56:43mbaraosetmessages: + msg264437
2016-04-28 16:31:46abarrysetnosy: + abarry
messages: + msg264435
2016-04-28 16:08:50mbaraocreate