mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #2134: Clarify token.OP handling rationale in tokenize documentation.
This commit is contained in:
parent
1b468af7be
commit
972cfb9169
2 changed files with 9 additions and 0 deletions
|
@ -15,6 +15,12 @@ implemented in Python. The scanner in this module returns comments as tokens
|
|||
as well, making it useful for implementing "pretty-printers," including
|
||||
colorizers for on-screen displays.
|
||||
|
||||
To simplify token stream handling, all :ref:`operators` and :ref:`delimiters`
|
||||
tokens are returned using the generic :data:`token.OP` token type. The exact
|
||||
type can be determined by checking the token ``string`` field on the
|
||||
:term:`named tuple` returned from :func:`tokenize.tokenize` for the character
|
||||
sequence that identifies a specific operator token.
|
||||
|
||||
The primary entry point is a :term:`generator`:
|
||||
|
||||
.. function:: tokenize(readline)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue