#9640: Change PARI error catching mechanism
-----------------------------------------------+---------------------------
       Reporter:  jdemeyer                     |        Owner:  was
           Type:  enhancement                  |       Status:
       Priority:  major                        |  needs_review
      Component:  interfaces                   |    Milestone:  sage-5.13
       Keywords:  pari error interrupt         |   Resolution:
        Authors:  Peter Bruin, Jeroen Demeyer  |    Merged in:
Report Upstream:  N/A                          |    Reviewers:
         Branch:                               |  Work issues:
   Dependencies:  #14029, #13311               |       Commit:
                                               |     Stopgaps:
-----------------------------------------------+---------------------------

Comment (by jdemeyer):

 Replying to [comment:28 pbruin]:
 > What is the use of `PariError.parimessage()`?  It doesn't seem to be
 used, and appears to normally be a substring of `PariError.__str__()`.  Do
 you have any application for it in mind, or can it be removed?
 For me, it can be removed. But it existed before (as a function
 `__errmessage()`) and one possible use would be to check that an error is
 of a given type without relying on the PARI error codes (for example, in
 pure Python code). Something like:
 {{{
 #!python
 try:
     pari.....
 except PariError as E:
     if E.parimessage() == "division by zero":
         raise ZeroDivisionError
     else:
         raise
 }}}
 Perhaps this is never going to happen, but at least the method
 `parimessage()` doesn't hurt either.

--
Ticket URL: <http://trac.sagemath.org/ticket/9640#comment:29>
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 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-trac.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to