Skip to content

Commit 2aa8519

Browse files
committed
The StopIteration API applies to both tokenize() and generate_tokens()
1 parent e970dc7 commit 2aa8519

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/library/tokenize.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ The primary entry point is a :term:`generator`:
2929
which must be a callable object which provides the same interface as the
3030
:meth:`readline` method of built-in file objects (see section
3131
:ref:`bltin-file-objects`). Each call to the function should return one line
32-
of input as a string.
32+
of input as a string. Alternately, *readline* may be a callable object that
33+
signals completion by raising :exc:`StopIteration`.
3334

3435
The generator produces 5-tuples with these members: the token type; the token
3536
string; a 2-tuple ``(srow, scol)`` of ints specifying the row and column

0 commit comments

Comments
 (0)