Index: Python/sysmodule.c =================================================================== --- Python/sysmodule.c (revision 83869) +++ Python/sysmodule.c (working copy) @@ -866,15 +866,10 @@ #endif PyDoc_STRVAR(getframe_doc, -"_getframe([depth]) -> frameobject\n\ +"_getframe(depth=0) -> frameobject\n\ \n\ -Return a frame object from the call stack. If optional integer depth is\n\ -given, return the frame object that many calls below the top of the stack.\n\ -If that is deeper than the call stack, ValueError is raised. The default\n\ -for depth is zero, returning the frame at the top of the call stack.\n\ -\n\ -This function should be used for internal and specialized\n\ -purposes only." +Return the frame object depth calls below the top of the stack. If there\n\ +is none, raise ValueError." ); static PyObject * Index: Doc/library/inspect.rst =================================================================== --- Doc/library/inspect.rst (revision 83869) +++ Doc/library/inspect.rst (working copy) @@ -534,9 +534,10 @@ raised. -.. function:: currentframe() +.. function:: currentframe(depth=0) - Return the frame object for the caller's stack frame. + Return the frame object *depth* calls below the top of the stack. If there is + none, raise :exc:`ValueError`. .. impl-detail:: Index: Doc/library/sys.rst =================================================================== --- Doc/library/sys.rst (revision 83869) +++ Doc/library/sys.rst (working copy) @@ -378,12 +378,10 @@ .. versionadded:: 3.2 -.. function:: _getframe([depth]) +.. function:: _getframe(depth=0) - 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, :exc:`ValueError` is raised. The default - for *depth* is zero, returning the frame at the top of the call stack. + Return the frame object *depth* calls below the top of the stack. If there is + none, raise :exc:`ValueError`. .. impl-detail::