#10063: Some determinants can not be computed
--------------------------------------------+-------------------------------
   Reporter:  tmonteil                      |       Owner:  tmonteil            
    
       Type:  defect                        |      Status:  needs_work          
    
   Priority:  critical                      |   Milestone:                      
    
  Component:  commutative algebra           |    Keywords:  determinant, ring, 
ideal
     Author:  Thierry Monteil               |    Upstream:  N/A                 
    
   Reviewer:  Mike Hansen, Sébastien Labbé  |      Merged:                      
    
Work_issues:                                |  
--------------------------------------------+-------------------------------
Changes (by slabbe):

  * status:  needs_review => needs_work
  * reviewer:  Mike Hansen => Mike Hansen, Sébastien Labbé


Comment:

 Dear Thierry,

 You included too much code inside of the try statement. You are "trying" a
 lot more than what is necessary, that is, {{{R.is_field()}}} in this case.
 From the [http://www.python.org/dev/peps/pep-0008/ PEP0008], cited in the
 Python coding conventions of the
 [http://www.sagemath.org/doc/developer/conventions.html#python-coding-
 conventions Sage Developpers Guide], one can read :

 {{{
     - Additionally, for all try/except clauses, limit the 'try' clause
       to the absolute minimum amount of code necessary.  Again, this
       avoids masking bugs.

       Yes:

           try:
               value = collection[key]
           except KeyError:
               return key_not_found(key)
           else:
               return handle_value(value)

       No:

           try:
               # Too broad!
               return handle_value(collection[key])
           except KeyError:
               # Will also catch KeyError raised by handle_value()
               return key_not_found(key)
 }}}

 Hence, you could do something like :

 {{{
     try:
         R_is_field = R.is_field()
     except NotImplementedError:
         ...

     if (algorithm is None and R_is_field and blablablal) or ...:
         ...
 }}}

 Finally, you need an empty line after the `::` for the documentation to
 build properly.

 Hence, I change the status of this ticket to needs work.

 Sébastien

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10063#comment:9>
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