#17175: Replace some __cmp__() by rich comparison
-------------------------------------+-------------------------------------
Reporter: aapitzsch | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: misc | Resolution:
Keywords: python3 | Merged in:
Authors: André Apitzsch | Reviewers: R. Andrew Ohana
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/aapitzsch/ticket/17175 | d419515eab7cade4ef3983159d87dd3b10998544
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by aapitzsch):
Replying to [comment:7 wluebbe]:
> Hi André, how did you select the modules from the //mountain// of
affected modules from ticket:16537? Is there a common theme? Just curious!
Up to some exceptions I chose the {{{__cmp__()}}} functions which only
checked for equality, where I hadn't to implement {{{__gt__()}}} etc.
> By the way, after seeing the size of the //cmp//-problem in ticket:16537
I was so shocked that I stopped working on Sage and Python 3! So this
gives me some fresh motivation ...
The main "problem" of replacing {{{__cmp__()}}} is pointed out in
http://www.mail-archive.com/[email protected]/msg73051.html.
Until we find a reasonable solution for it, we should continue with the
easier tickets, like #16529.
> What is the reason for explicitly defining all 4 comparisons in
{{{src/sage/dynamics/flat_surfaces/strata.py}}} instead of defining one
(e.g. {{{__gt__}}}) and using the class decorator
{{{functools.total_ordering}}}?
All comparisons need {{{self._marked_separatrix ==
other._marked_separatrix}}} and I think this leads to problems with the
class decorator.
--
Ticket URL: <http://trac.sagemath.org/ticket/17175#comment:8>
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.