You are viewing an older version (9.3.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.3.0 / IPython / core / inputtransformer2 / assemble_continued_line

function

IPython.core.inputtransformer2:assemble_continued_line

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

Signature

def   assemble_continued_line ( lines start : Tuple[int, int] end_line : int )

Summary

Assemble a single line from multiple continued line pieces

Extended Summary

Continued lines are lines ending in \``, and the line following the last ``\ in the block.

For example, this code continues over multiple lines

if (assign_ix is not None) \
     and (len(line) >= assign_ix + 2) \
     and (line[assign_ix+1].string == '%') \
     and (line[assign_ix+2].type == tokenize.NAME):

This statement contains four continued line pieces. Assembling these pieces into a single line would give

if (assign_ix is not None) and (len(line) >= assign_ix + 2) and (line[...

This uses 0-indexed line numbers. start is (lineno, colno).

Used to allow %magic and !system commands to be continued over multiple lines.

Aliases

  • IPython.core.inputtransformer2.assemble_continued_line