PyDocs

Nav

Python Language Services

untokenize

tokenize

function (source)
  • untokenize(iterable)
Transform tokens back into Python source code.
It returns a bytes object, encoded using the ENCODING
token, which is the first token sequence output by tokenize.

Each element returned by the iterable must be a token sequence
with at least two elements, a token number and token value.  If
only two tokens are passed, the resulting output is poor.

The result is guaranteed to tokenize back to match the input so
that the conversion is lossless and round-trips are assured.
The guarantee applies only to the token type and token string as
the spacing between tokens (column positions) may change.
0 Examples
No examples for tokenize/untokenize.
See Also
No see-alsos for tokenize/untokenize
0 Notes
No notes for untokenize