[issue26874] Docstring error in divmod function
New submission from mbarao: 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. ---------- assignee: docs@python components: Documentation messages: 264434 nosy: docs@python, mbarao priority: normal severity: normal status: open title: Docstring error in divmod function type: enhancement versions: Python 3.5 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26874> _______________________________________
Emanuel Barry added the comment: 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 ---------- nosy: +ebarry _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26874> _______________________________________
mbarao added the comment: See divmod.__doc__ ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26874> _______________________________________
Changes by Serhiy Storchaka <storchaka@gmail.com>: ---------- nosy: +eric.smith, lemburg, mark.dickinson, stutzbach _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26874> _______________________________________
Mark Dickinson added the comment:
I think it should be ((x-x%y)//y, x%y) where an integer division is used.
How about simply (x//y, x%y)? ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26874> _______________________________________
Roundup Robot added the comment: 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 ---------- nosy: +python-dev resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26874> _______________________________________
Zachary Ware added the comment: 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. ---------- nosy: +zach.ware resolution: fixed -> stage: resolved -> status: closed -> open _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26874> _______________________________________
Roundup Robot added the comment: 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 ---------- resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26874> _______________________________________
Roundup Robot added the comment: 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 ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26874> _______________________________________
Zachary Ware added the comment: Forgot that step, thanks Serhiy! ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue26874> _______________________________________
participants (6)
-
Emanuel Barry
-
Mark Dickinson
-
mbarao
-
Roundup Robot
-
Serhiy Storchaka
-
Zachary Ware