summaryrefslogtreecommitdiff
path: root/Doc/library/tokenize.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-04-29 00:34:27 +0000
committerRaymond Hettinger <python@rcn.com>2009-04-29 00:34:27 +0000
commit31858587ef0a8acb7b20db6a603bdbe61640d766 (patch)
tree407fe00f091c4e393d7d59b3d7900c2f6a5a5474 /Doc/library/tokenize.rst
parent4124ccb1c0c6db5e5d6aaacc4972cb605cb33de1 (diff)
downloadcpython-31858587ef0a8acb7b20db6a603bdbe61640d766.tar.gz
Issue #5857: tokenize.tokenize() now returns named tuples.
Diffstat (limited to 'Doc/library/tokenize.rst')
-rw-r--r--Doc/library/tokenize.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst
index acb0b786fc..deb7826393 100644
--- a/Doc/library/tokenize.rst
+++ b/Doc/library/tokenize.rst
@@ -27,7 +27,12 @@ The primary entry point is a :term:`generator`:
column where the token begins in the source; a 2-tuple ``(erow, ecol)`` of
ints specifying the row and column where the token ends in the source; and
the line on which the token was found. The line passed (the last tuple item)
- is the *logical* line; continuation lines are included.
+ is the *logical* line; continuation lines are included. The 5 tuple is
+ returned as a :term:`named tuple` with the field names:
+ ``type string start end line``.
+
+ .. versionchanged:: 3.1
+ Added support for named tuples.
:func:`tokenize` determines the source encoding of the file by looking for a
UTF-8 BOM or encoding cookie, according to :pep:`263`.