#17890: Remove _(rich)cmp_c_impl
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.6
      Component:  cython             |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jeroen Demeyer     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/jdemeyer/ticket/17890            |  17bd067153ad40ced061147390687f514a7f7cba
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:30 jdemeyer]:
 > Replying to [comment:27 vdelecroix]:
 > > - comparison involving coercion is '''wrong''': if you call
 {{{cmp(a,b)}}} with `a` and `b` between two parents `A` and `B` and a
 coercion `B -> A` then `Element.__richcmp__` is called instead of
 `Element.__cmp__`.
 > >
 > > Actually, this is not only a bug in Python
 > Bug or feature?

 Call it whatever you want: `cmp(a1,a2)` (same type) calls `__cmp__` but
 `cmp(a,b)` (different types) does not and use `__richcmp__` instead. The
 consequence is that you might perform three times the coercion while
 calling `cmp` with elements with different parents!

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