#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:32 jdemeyer]:
 > Replying to [comment:28 vdelecroix]:
 > > Moreover if you redefine `__cmp__` in your Element class then
 `Element.__cmp__` is not called!
 > Of course not, that's a general rule for inheritance.

 I thought this was not the case for cython classes which redefine
 `__hash__`! Is it only true for `__richcmp__`?

 > > So the test in `Element._cmp` seems useless.
 > What do you mean?

 Sorry, I forgot a `_`. I wanted to say `Element._cmp_`. The default
 implementation does check whether `__cmp__` is redefined in element
 classes. This code is called only if `__cmp__` is defined but not
 `_richcmp_`. And it seems much better to define `_richcmp_` in children
 classes.

 Vincent

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