PyDocs

Nav

Python Runtime Services

_getframe

sys

function
  • _getframe([depth])
Return a frame object from the call stack.

If optional integer depth is given, return the frame object that many
calls below the top of the stack.  If that is deeper than the call
stack, ValueError is raised.  The default for depth is zero, returning
the frame at the top of the call stack.

This function should be used for internal and specialized purposes
only.

The official docs include a CPython implementation detail for this entry.

0 Examples
No examples for sys/_getframe.
See Also
No see-alsos for sys/_getframe
0 Notes
No notes for _getframe