On 2016-12-22 11:25, Jean-Pierre Flori wrote:
Dear all,

First question: Is there are fundamental differences btw using the
cysignal alarm function and the one from the signal module?

Depends what you mean with "fundamental". The internal implementation is different. The main user-visible difference is that Python's alarm requires an integer timeout, while cysignals accepts a floating-point timeout.

Second question: Is there any reason to make AlarmInterrupt derive from
KeyboardInterrupt?
SIGALARM and SIGINT are different signals.

I give you 3 reasons:

1. Historically, Sage has used KeyboardInterrupt for alarm(). So deriving AlarmInterrupt from KeyboardInterrupt is backwards-compatible with code catching KeyboardInterrupt for alarms.

2. Conceptually, KeyboardInterrupt and AlarmInterrupt are quite close. They both originate from signals and can interrupt code in the middle of a computation.

3. Since alarm() raises a sub-class of KeyboardInterrupt, alarm() provides an easy way to test interrupt-handling of code.

And its troublesome when using sage pexpect interfaces as they eat
KeyboardInterrupt (and so AlarmInterrupt).

What do you mean, they "eat" KeyboardInterrupt?

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to