PyDocs

Nav

Python Runtime Services

StackSummary.extract

traceback

classmethod of StackSummary (source)
  • StackSummary.extract(frame_gen, *, limit=None, lookup_lines=True, capture_locals=False)
Create a StackSummary from a traceback or stack object.

:param frame_gen: A generator that yields (frame, lineno) tuples
    whose summaries are to be included in the stack.
:param limit: None to include all frames or the number of frames to
    include.
:param lookup_lines: If True, lookup lines for each frame immediately,
    otherwise lookup is deferred until the frame is rendered.
:param capture_locals: If True, the local variables from each frame will
    be captured as object representations into the FrameSummary.
Changed in 3.12
  • 3.12: Exceptions raised from repr() on a local variable (when capture_locals is True) are no longer propagated to the caller.
0 Examples
No examples for traceback/StackSummary.extract.
See Also
No see-alsos for traceback/StackSummary.extract
0 Notes
No notes for StackSummary.extract