monty 0.0.20

A sandboxed, snapshotable Python interpreter written in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
# Test that recursive function calls hit the recursion limit
# This uses Python function call recursion which both CPython and Monty limit


def recurse(n):
    if n == 0:
        return 0
    return recurse(n - 1) + 1


# This should raise RecursionError in both interpreters
recurse(2000)
# Raise=RecursionError('maximum recursion depth exceeded')