{ } Raw JSON

bundles / IPython 9.17.0 / IPython / core / ultratb / ListTB / structured_traceback

function

IPython.core.ultratb:ListTB.structured_traceback

source: /dev/ipython/IPython/core/ultratb.py:151

Signature

def structured_traceback(self, etype: type, evalue: BaseException | None, etb: TracebackType | None = None, tb_offset: int | None = None, context: int = 5) → list[str]

Summary

Return a color formatted string with the traceback info.

Parameters

etype : exception type

Type of the exception raised.

evalue : object

Data stored in the exception

etb : list | TracebackType | None

If list: List of frames, see class docstring for details. If Traceback: Traceback of the exception.

tb_offset : int, optional

Number of frames in the traceback to skip. If not given, the instance evalue is used (set in constructor).

context : int, optional

Number of lines of context information to print.

Returns

: String with formatted exception.

Aliases

  • IPython.core.ultratb.ListTB.structured_traceback