From c03618ab2d78cde82a0a63310ed0781b649b2605 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Sat, 18 Feb 2017 12:03:25 +0530 Subject: [PATCH 1/3] bpo-29521 document return type of next method of csv reader --- Doc/library/csv.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst index 52a8a310ec9d623..d5f4cd6158d012c 100644 --- a/Doc/library/csv.rst +++ b/Doc/library/csv.rst @@ -401,8 +401,9 @@ Reader objects (:class:`DictReader` instances and objects returned by the .. method:: csvreader.__next__() - Return the next row of the reader's iterable object as a list, parsed according - to the current dialect. Usually you should call this as ``next(reader)``. + 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. Usually you + should call this as ``next(reader)``. Reader objects have the following public attributes: From b2638a0ec905f471362064f3c59bf5614897de68 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Sat, 18 Feb 2017 23:03:07 +0530 Subject: [PATCH 2/3] Explicitly mention the object type reader()/DictReader --- Doc/library/csv.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst index d5f4cd6158d012c..c60b4cd570d0d08 100644 --- a/Doc/library/csv.rst +++ b/Doc/library/csv.rst @@ -401,9 +401,10 @@ Reader objects (:class:`DictReader` instances and objects returned by the .. method:: 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. Usually you - should call this as ``next(reader)``. + Return the next row of the reader's iterable object as a list (if the object + was returned from ``reader()``) or a dict (if it is a ``DictReader``), parsed + according to the current dialect. Usually you should call this as + ``next(reader)``. Reader objects have the following public attributes: From b3699ad43902d7a00b149e87cd9221644285e5a6 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Tue, 21 Feb 2017 19:37:05 +0530 Subject: [PATCH 3/3] Address comments: use :func: and :class: --- Doc/library/csv.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst index c60b4cd570d0d08..43714f7479283d6 100644 --- a/Doc/library/csv.rst +++ b/Doc/library/csv.rst @@ -402,9 +402,9 @@ Reader objects (:class:`DictReader` instances and objects returned by the .. method:: csvreader.__next__() Return the next row of the reader's iterable object as a list (if the object - was returned from ``reader()``) or a dict (if it is a ``DictReader``), parsed - according to the current dialect. Usually you should call this as - ``next(reader)``. + was returned from :func:`reader`) or a dict (if it is a :class:`DictReader` + instance), parsed according to the current dialect. Usually you should call + this as ``next(reader)``. Reader objects have the following public attributes: