#17890: Remove _(rich)cmp_c_impl
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  enhancement        |       Status:  new
       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            |  25e517fc735d15ba07c919f7a65103cf04acd2cf
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Description changed by jdemeyer:

Old description:

> Instead of
> {{{
>     def _cmp_(left, right)
>     cdef int _cmp_c_impl(left, right) except -2
> }}}
> we should have
> {{{
>     cpdef int _cmp_(left, right) except -2
> }}}
>
> Analogously for `_richcmp_`.
>
> Attached branch passes all doctests, but is somewhat slower than before.

New description:

 Instead of
 {{{
     def _cmp_(left, right)
     cdef int _cmp_c_impl(left, right) except -2
 }}}
 we should have
 {{{
     cpdef int _cmp_(left, right) except -2
 }}}

 Analogously for `_richcmp_`.

 There is one important functional change: If a Python class defines both
 `__cmp__` and `_cmp_`, then formerly the coercion framework would use
 `__cmp__` by default to implement relational operators like `>=`. After
 this ticket, `_cmp_` will be tried first, which defaults to `__cmp__`.

--

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