diff options
author | Raymond Hettinger <python@rcn.com> | 2012-07-02 03:00:09 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2012-07-02 03:00:09 (GMT) |
commit | 2aa8519f07bff9e7a04e62e2e4d11c87d18bb846 (patch) | |
tree | 9fe413790f75140f71c3e00dfea7604707598fd2 /Doc | |
parent | e970dc757cc2795e5dabf542fd002b540b3d7bc2 (diff) | |
download | cpython-2aa8519f07bff9e7a04e62e2e4d11c87d18bb846.zip cpython-2aa8519f07bff9e7a04e62e2e4d11c87d18bb846.tar.gz cpython-2aa8519f07bff9e7a04e62e2e4d11c87d18bb846.tar.bz2 |
The StopIteration API applies to both tokenize() and generate_tokens()
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/tokenize.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst index 7075035..d037452 100644 --- a/Doc/library/tokenize.rst +++ b/Doc/library/tokenize.rst @@ -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 :meth:`readline` method of built-in file objects (see section :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 string; a 2-tuple ``(srow, scol)`` of ints specifying the row and column |