Re: coroutines and continuations ( in Python? - long discussion )

lance@fox.com
Tue, 3 May 94 16:32:25 PDT

> From: Guido.van.Rossum@cwi.nl
> Date: Tue, 03 May 1994 23:02:52 +0200
>
> > >4) I don't think that it would be a good idea to allow exceptions to
> > >be restarted, even if it were possible. They are generally used in
> > >situations where there is no sensible course of action possible. If a
> >
> > EXCEPT for KeyboardInterrupt, which can be triggered anywhere and is
> > hard to trap in such a way that you can always reenter the codeblock.
> > I still have no fool-proof way to ignore KeyboardInterrupt or create a
> > handler that terminates your program if you wish, but continues
> > otherwise. :-(
>
> This shuld be solved by Lance's signal handling module -- the default
> SIGINT handler will then raise KeyboardInterrupt. Until then, I'm not
> going to change things. (Hey Lance! How's it going?)

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

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 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?

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?

--
Lance Ellinghouse                lance@fox.com