{ } Raw JSON

bundles / IPython 9.13.0 / IPython / core / inputtransformer2 / make_tokens_by_line

function

IPython.core.inputtransformer2:make_tokens_by_line

source: /IPython/core/inputtransformer2.py :598

Signature

def   make_tokens_by_line ( lines : List[str] )

Summary

Tokenize a series of lines and group tokens by line.

Extended Summary

The tokens for a multiline Python string or expression are grouped as one line. All lines except the last lines should keep their line ending ('n', 'rn') for this to properly work. Use .splitlines(keeplineending=True) for example when passing block of text to this function.

Aliases

  • IPython.core.inputtransformer2.make_tokens_by_line