diff options
author | Raymond Hettinger <python@rcn.com> | 2009-04-29 00:34:27 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2009-04-29 00:34:27 (GMT) |
commit | a48db39992aaf4d83759135e4c9a2c9757764e62 (patch) | |
tree | 5b7f42744c49276193269698a72231b3a4814c75 /Doc/library | |
parent | c1edc2d632a8897509e5807b3a58c529c75d5c91 (diff) | |
download | cpython-a48db39992aaf4d83759135e4c9a2c9757764e62.zip cpython-a48db39992aaf4d83759135e4c9a2c9757764e62.tar.gz cpython-a48db39992aaf4d83759135e4c9a2c9757764e62.tar.bz2 |
Issue #5857: tokenize.tokenize() now returns named tuples.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/tokenize.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst index acb0b78..deb7826 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`. |