#16127: Fix comparison of PARI objects
-------------------------------------+-------------------------------------
       Reporter:  pbruin             |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  critical           |    Milestone:  sage-6.4
      Component:  interfaces         |   Resolution:
       Keywords:  pari comparison    |    Merged in:
        Authors:  Peter Bruin        |    Reviewers:  Jeroen Demeyer
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/ticket/16127            |  12fbcad65c6438fe0495c3b2424468f24b49a9ee
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by pbruin):

 Why do you make `<=` and `>=` return `True` for equal objects?  To me it
 doesn't make a lot of sense.  I can see that you might want that `a == b`
 implies `a <= b`, but in my opinion asking whether `a <= b` only makes
 sense if `a` and `b` are in some partially ordered set (like the real
 numbers with plus and minus infinity).

 Neither PARI nor Sage returns true for `[0] <= 0` (while they disagree on
 `[0] == 0`):
 {{{
 gp > [0] <= 0
   ***   at top-level: [0]<=0
   ***                    ^---
   *** _<=_: forbidden comparison t_VEC (1 elts) , t_INT.
 gp > [0] == 0
 %1 = 1
 }}}
 {{{
 sage: [0] <= 0
 False
 sage: [0] == 0
 False
 }}}
 Note also the following from the
 [https://docs.python.org/2/reference/datamodel.html#special-method-names
 Python documentation]: "There are no implied relationships among the
 comparison operators. The truth of `x==y` does not imply that `x!=y` is
 false."  Likewise, I don't think we should insist that the truth of `x==y`
 implies that of `x<=y`.

--
Ticket URL: <http://trac.sagemath.org/ticket/16127#comment:18>
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/d/optout.

Reply via email to