{ } Raw JSON

bundles / IPython 9.17.0 / IPython / core / tbtools / _simple_format_traceback_lines

function

IPython.core.tbtools:_simple_format_traceback_lines

source: /dev/ipython/IPython/core/tbtools.py:221

Signature

def _simple_format_traceback_lines(lnum: int, index: int, lines: list[tuple[str, tuple[str, bool]]], lvals_toks: list[TokenStream], theme: Theme) → TokenStream

Summary

Format tracebacks lines with pointing arrow, leading numbers

Extended Summary

This should be equivalent to _format_traceback_lines, but does not rely on stackdata to format the lines

This is due to the fact that stackdata may be slow on super long and complex files.

Parameters

lnum: int

number of the target line of code.

index: int

which line in the list should be highlighted.

lines: list[string]
lvals_toks: pairs of token type and str

Values of local variables, already colored, to inject just after the error line.

Aliases

  • IPython.core.tbtools._simple_format_traceback_lines