#10791: Fix and upgrade Gram-Schmidt
------------------------------+---------------------------------------------
   Reporter:  rbeezer         |          Owner:  jason, was
       Type:  defect          |         Status:  needs_info
   Priority:  major           |      Milestone:  sage-4.7  
  Component:  linear algebra  |       Keywords:            
Work_issues:                  |       Upstream:  N/A       
   Reviewer:  Martin Raum     |         Author:  Rob Beezer
     Merged:                  |   Dependencies:            
------------------------------+---------------------------------------------
Changes (by rbeezer):

  * status:  needs_review => needs_info


Comment:

 Replying to [comment:12 jdemeyer]:
 > Using a bare {{{except:}}} (line 6303 of {{{sage/matrix/matrix2.pyx}}})
 is a very bad idea.  You should catch specific exceptions, not all.

 Yes, I became aware of this many months ago.  However, I never know just
 what to be catching.  In other words, it would be nice to use a
 {{{__call___}}} method as a way to sanitize input, but I often have
 trouble figuring out just how the code will react when it fails (just what
 type of error will come back).

 So which is preferable:

 {{{
 try:
    n = Integer(n_input)
 except SomeError:
    raise ....
 }}}

 or

 {{{
 if not is_Integer(n_input):
     raise ...
 else:
     n = Integer(n_input)
 }}}

 In the first case is it enough to just catch  `TypeError` and
 `ValueError`?

 In the second case, I am often at a loss to decide which to use, in
 particular I once spent a very long time trying to determine if an input
 was a real number.

 So my naked except is really an act of desperation.  Advice would be
 appreciated.

 Rob

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