On Tue, Jan 28, 2014 at 11:58:19AM +0100, Jeroen Demeyer wrote: > On 2014-01-28 07:25, John H Palmieri wrote: > > > > > >On Monday, January 27, 2014 10:13:28 PM UTC-8, Georgi Guninski wrote: > > > > Dear sir or madam, > > > > How to cancel alarm in BOTH sage 5.12 AND 5.13? > > > > cancel_alarm() works only in 5.13 > > alarm(0) works only in 5.12 (and maybe earlier) > > > > > >I believe that > > > > from sage.misc.misc import cancel_alarm > > cancel_alarm() > > > >should work in all versions of Sage dating back to at least version > >4.1.2 (that's the oldest version I have easily accessible to test with). > Or use Python's signal.alarm(n) to set an alarm for n seconds and > signal.alarm(0) to cancel it. >
Dear sir or madam, I agree that one should avoid using code written by intoxicated sage developers. Appears to me on 5.13 alarm(RR(10)^(-300)) cancels a pending alarm as per the documentation of setitimer(2). sage: alarm(0.5);alarm(RR(10)^(-300));sleep(1);print "fuck" fuck -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.
