#7794: PolynomialRing_integral_domain ignores Ctrl-C and segfaults
--------------------------+-------------------------------------------------
   Reporter:  SimonKing   |          Owner:  AlexGhitza                       
       Type:  defect      |         Status:  needs_review                     
   Priority:  critical    |      Milestone:  sage-4.7.1                       
  Component:  algebra     |       Keywords:  Polynomial Ring KeyboardInterrupt
Work_issues:              |       Upstream:  N/A                              
   Reviewer:  Simon King  |         Author:                                   
     Merged:              |   Dependencies:                                   
--------------------------+-------------------------------------------------

Comment(by SimonKing):

 I considered the following version of get_cparent in
 polynomial_zmod_flint.pyx:
 {{{
 cdef inline cparent get_cparent(parent) except 1:
     if parent is None:
         return 0
     try:
         return <unsigned long>(parent.modulus())
     except AttributeError:
         return 0
 }}}

 Rationale:

 The original code was catching an error that should probably be an
 attribute error - so, we do the same, and return the same value that was
 returned by the original version.

 But the return value 1 can never occur (which I verified by the doctests
 of sage/rings/). So, it is safe to reserve 1 as the exceptional value,
 without question mark after `except`.

 However, our two patch versions performed equally when I tried some
 timings. Hence, unless you say that I convinced you to use 1 as
 exceptional return value (without question mark), I will give your patch a
 positive review, provided the doc tests pass.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7794#comment:14>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to