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

Function get_recursion_available

Lib/test/support/__init__.py:2495–2503  ·  view source on GitHub ↗

Get the number of available frames before RecursionError. It depends on the current recursion depth of the caller function and sys.getrecursionlimit().

()

Source from the content-addressed store, hash-verified

2493 return max(depth - 1, 1)
2494
2495def get_recursion_available():
2496 """Get the number of available frames before RecursionError.
2497
2498 It depends on the current recursion depth of the caller function and
2499 sys.getrecursionlimit().
2500 """
2501 limit = sys.getrecursionlimit()
2502 depth = get_recursion_depth()
2503 return limit - depth
2504
2505@contextlib.contextmanager
2506def set_recursion_limit(limit):

Callers

nothing calls this directly

Calls 1

get_recursion_depthFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…