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

Function stack

Lib/inspect.py:1683–1685  ·  view source on GitHub ↗

Return a list of records for the stack above the caller's frame.

(context=1)

Source from the content-addressed store, hash-verified

1681 return sys._getframe(1) if hasattr(sys, "_getframe") else None
1682
1683def stack(context=1):
1684 """Return a list of records for the stack above the caller's frame."""
1685 return getouterframes(sys._getframe(1), context)
1686
1687def trace(context=1):
1688 """Return a list of records for the stack below the current exception."""

Callers

nothing calls this directly

Calls 1

getouterframesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…