[issue21056] csv documentation is incorrect
New submission from NRGunby: The documentation for the csv reader objects next() method is incorrect. It states ' csvreader.next() Return the next row of the reader’s iterable object as a list, parsed according to the current dialect.' Either the documentation for DictReader objects needs to be be made separate from normal reader objects, or this needs to be amended to say ' csvreader.next() Return the next row of the reader’s iterable object as a list (if reader) or dict (if DictReader), parsed according to the current dialect. ' I observed this in the 2.7 online docs, found it to be the case in the 3.4 online docs as well, and haven't checked other versions but assume it's the case. ---------- assignee: docs@python components: Documentation messages: 214775 nosy: NRGunby, docs@python priority: normal severity: normal status: open title: csv documentation is incorrect type: behavior versions: Python 2.7, Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Josh Rosenberg added the comment: Aside from the method being named __next__(), it's the same flaw in all copies of the Py3 documentation. I don't think explicitly enumerating types is the way to go though. I'd just remove the documentation for __next__, and leave it up to the per-type documentation to describe the data structure returned when iterating. None of the other built-in types in Py3 bother to explicitly document "internal" methods like __next__, but rather describe iteration while describing the type itself. ---------- nosy: +josh.rosenberg _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- keywords: +easy stage: -> needs patch versions: +Python 3.5, Python 3.6 -Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Sanket Dasgupta added the comment: Hi, I am looking to fix this bug. So as per the discussion, should I remove the documentation of __next__() ? ---------- nosy: +sanketdg _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Changes by Amit Kumar <dtu.amit@gmail.com>: ---------- pull_requests: +110 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Mariatta Wijaya added the comment: New changeset d618c8c6d31b9b288f8a070417683974eb98e3ba by Mariatta (Amit Kumar) in branch 'master': bpo-21056: Document return type of next method of csv reader (#146) https://github.com/python/cpython/commit/d618c8c6d31b9b288f8a070417683974eb9... ---------- nosy: +Mariatta _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Changes by Mariatta Wijaya <mariatta.wijaya@gmail.com>: ---------- stage: needs patch -> backport needed versions: +Python 3.7 -Python 2.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Changes by Mariatta Wijaya <mariatta.wijaya@gmail.com>: ---------- pull_requests: +1837 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Changes by Mariatta Wijaya <mariatta.wijaya@gmail.com>: ---------- pull_requests: +1838 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Łukasz Langa added the comment: New changeset 6ef0882303cff24c58785bb1082250088266886d by Łukasz Langa (Mariatta) in branch '3.6': [3.6] bpo-21056: Document return type of next method of csv reader (GH-146) (#1749) https://github.com/python/cpython/commit/6ef0882303cff24c58785bb108225008826... ---------- nosy: +lukasz.langa _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Łukasz Langa added the comment: New changeset 32dcf426ad2ae10e24e92f60e99dbb4939fb2021 by Łukasz Langa (Mariatta) in branch '3.5': [3.5] bpo-21056: Document return type of next method of csv reader (GH-146) (#1750) https://github.com/python/cpython/commit/32dcf426ad2ae10e24e92f60e99dbb4939f... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
Changes by Mariatta Wijaya <mariatta.wijaya@gmail.com>: ---------- resolution: -> fixed stage: backport needed -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue21056> _______________________________________
participants (7)
-
Amit Kumar -
Berker Peksag -
Josh Rosenberg -
Mariatta Wijaya -
NRGunby -
Sanket Dasgupta -
Łukasz Langa