Interpreter.clear_state

Interpreter.clear_state()

Clears the state of the interpreter. That includes the sys module, all imported modules, the signal handlers and the tty state (termios, window size).

PytoRuntime implements a garbage collector. When the pyto_runtime.Interpreter object is deallocated, it gets scheduled for state clearing before the next script executes on any interpreter.