It's fairer to ask for interactive mode, in which you can redefine things and restart your tests:
$ python3 -i interrupt.py
0
1
2
^CTraceback (most recent call last):
File "interrupt.py", line 12, in <module>
drill(10, gen)
File "interrupt.py", line 7, in drill
time.sleep(1)
KeyboardInterrupt
>>> def gen(n):
... print('{}!'.format(n))
...
>>> drill(10, gen)
0!
1!
2!
3!
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "interrupt.py", line 7, in drill
time.sleep(1)
KeyboardInterrupt
>>>
What's magic about the Lisp version is not the "in debug mode, you get a REPL and can redefine stuff" part. What's magic about the Lisp version is the "you can then continue the test where you left off" part. That's impossible in Python because exceptions unwind the stack.