MCPcopy Index your code
hub / github.com/python/cpython / print_stack

Function print_stack

Lib/traceback.py:242–251  ·  view source on GitHub ↗

Print a stack trace from its invocation point. The optional 'f' argument can be used to specify an alternate stack frame at which to start. The optional 'limit' and 'file' arguments have the same meaning as for print_exception().

(f=None, limit=None, file=None)

Source from the content-addressed store, hash-verified

240#
241
242def print_stack(f=None, limit=None, file=None):
243 """Print a stack trace from its invocation point.
244
245 The optional 'f' argument can be used to specify an alternate
246 stack frame at which to start. The optional 'limit' and 'file'
247 arguments have the same meaning as for print_exception().
248 """
249 if f is None:
250 f = sys._getframe().f_back
251 print_list(extract_stack(f, limit=limit), file=file)
252
253
254def format_stack(f=None, limit=None):

Callers

nothing calls this directly

Calls 2

print_listFunction · 0.85
extract_stackFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…