:mod:`token` --- Constants used with Python parse trees
Source code: :source:`Lib/token.py`
This module provides constants which represent the numeric values of leaf nodes of the parse tree (terminal tokens). Refer to the file :file:`Grammar/Grammar` in the Python distribution for the definitions of the names in the context of the language grammar. The specific numeric values which the names map to may change between Python versions.
The module also provides a mapping from numeric codes to names and some functions. The functions mirror definitions in the Python C header files.
The token constants are:
The following token type values aren't used by the C tokenizer but are needed for the :mod:`tokenize` module.