#17175: Replace some __cmp__() by rich comparison
-------------------------------------+-------------------------------------
Reporter: aapitzsch | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.4
Component: misc | Resolution:
Keywords: | Merged in:
Authors: André Apitzsch | Reviewers: R. Andrew Ohana
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/aapitzsch/ticket/17175 | 8e6a4890f80a9cbab620a777495dd7ac27d81d5d
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by ohanar):
* status: needs_review => needs_work
* reviewer: => R. Andrew Ohana
Comment:
Thanks for working on this. I haven't looked through everything thoroughly
yet, but here are some initial comments/questions:
* In {{{sage.combinat.e_one_star}}} (and in general), why do you change
the expression in {{{__eq__}}} method to use backslashes instead of
parens? According to PEP8, wrapping long lines should be done with parens,
brackets, and braces rather than with backslashes.
* In {{{sage.combinat.root_system.branching_rules}}},
{{{sage.doctest.*}}}, and {{{sage.rings.finit_rings.residue_field}}},
using {{{not isinstance(other, type(self))}}} is not equivalent to the
previous line of reasoning (i.e. {{{type(self)}}} might be a super class
of {{{type(other)}}}). Instead use something like {{{other.__class__ is
not self.__class__}}} (using {{{__class__}}} is better than {{{type}}} for
duck typing purposes).
* In {{{sage.combinat.root_system.type_irreducible}}}, it seems to me
that the added {{{__ne__}}} method is unecessary.
* In {{{sage.dynamics.flat_surfaces.strata}}}, you seemed to have removed
the less than and greater than functionality (that wasn't being tested by
the doctests).
--
Ticket URL: <http://trac.sagemath.org/ticket/17175#comment:2>
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.