在REPL中,我们通常可以用sigint中断无限循环,即 CTRL+C,并重新获得口译员的控制权。
>>> while True: pass
...
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyboardInterrupt
>>>
但是在这个循环中,中断似乎被阻止了,我必须杀死父进程才能逃脱。
>>> *x, = itertools.repeat('x')
^C^C^C^C^C^C^C^C^\^\^\^\^\^Z^Z^Z^Z
这是为什么?