Skip to content

Commit 72b6259

Browse files
graingertThomas Grainger
authored and
Thomas Grainger
committed
csv readers take iterables as well as iterators
1 parent 4f9a446 commit 72b6259

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Doc/library/csv.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ The :mod:`csv` module defines the following functions:
5656
.. function:: reader(csvfile, dialect='excel', **fmtparams)
5757

5858
Return a reader object which will iterate over lines in the given *csvfile*.
59-
*csvfile* can be any object which supports the :term:`iterator` protocol and returns a
60-
string each time its :meth:`!__next__` method is called --- :term:`file objects
59+
*csvfile* can be any object which supports the :term:`iterable` protocol and returns an
60+
iterator that returns a string each time its :term`iterator`'s :meth:`!__next__` method
61+
is called when its :meth:`!__iter__` method is called --- :term:`file objects
6162
<file object>` and list objects are both suitable. If *csvfile* is a file object,
6263
it should be opened with ``newline=''``. [1]_ An optional
6364
*dialect* parameter can be given which is used to define a set of parameters
@@ -416,7 +417,7 @@ Reader objects have the following public attributes:
416417

417418
.. attribute:: csvreader.line_num
418419

419-
The number of lines read from the source iterator. This is not the same as the
420+
The number of lines read from the source iterable. This is not the same as the
420421
number of records returned, as records can span multiple lines.
421422

422423

0 commit comments

Comments
 (0)