mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
The StopIteration API applies to both tokenize() and generate_tokens()
This commit is contained in:
parent
e970dc757c
commit
2aa8519f07
1 changed files with 2 additions and 1 deletions
|
@ -29,7 +29,8 @@ The primary entry point is a :term:`generator`:
|
||||||
which must be a callable object which provides the same interface as the
|
which must be a callable object which provides the same interface as the
|
||||||
:meth:`readline` method of built-in file objects (see section
|
:meth:`readline` method of built-in file objects (see section
|
||||||
:ref:`bltin-file-objects`). Each call to the function should return one line
|
:ref:`bltin-file-objects`). Each call to the function should return one line
|
||||||
of input as a string.
|
of input as a string. Alternately, *readline* may be a callable object that
|
||||||
|
signals completion by raising :exc:`StopIteration`.
|
||||||
|
|
||||||
The generator produces 5-tuples with these members: the token type; the token
|
The generator produces 5-tuples with these members: the token type; the token
|
||||||
string; a 2-tuple ``(srow, scol)`` of ints specifying the row and column
|
string; a 2-tuple ``(srow, scol)`` of ints specifying the row and column
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue