Re: coroutines and continuations ( in Python? - long discussion )
Thu, 05 May 1994 11:07:28 +0200

> Actually the signal module is comming very well... and yes.. once the
> signal module is finished you can just assign a function like the following
> to disable the KeyboardInterrupt:
> def null_sigint(sig_num):
> pass
> and yes the default SIGINT handler does just the following:
> def default_sigint(sig_num):
> raise KeyboardInterrupt

Good! I'd love to see it in the next release!

> I do have one question that I posted to the mailing list but never saw
> it or got a response from it so I doubt it got there.

I guess the message got lost, I can't remember I saw it.

> I need to add a SignalInterrupt exception and was thinking of adding it
> to __builtin__ so that you could just use SignalInterrupt anywhere
> without having to import signal. Does this make sense or should I just
> leave it in the signal module?

I don't know what it should do but as I believe that your signal
interface will become a permanent part of Python I don't see a problem
with putting it in __builtin__.

> Also, should I pass a second option to the signal handler routine
> that is a traceback object? or a frameobject?
> Or should I just pass in the signal_number?

The frame object sounds like the proper thing to do here. Traceback
objects are only used to keep past frames alive -- when a signal
handler is called the current frame is still alive so there is no need
for a traceback yet.

--Guido van Rossum, CWI, Amsterdam <>
URL: <>