#18305: Element comparison for Python classes
---------------------------+----------------------------------
Reporter: vdelecroix | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.7
Component: coercion | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies: #17890, #18303
Stopgaps: |
---------------------------+----------------------------------
In #17890 the comparisons of elements (i.e. through `__cmp__` and
`__richcmp__`) has been simplified. In order for elements to take benefit
of the coercion framekwork they should either implement
`_cmp_(left,right)` and/or `_richcmp_(left,right,op)`.
In particular, it is discouraged to implement `__eq__` and `__ne__` if
coercion has to be involved. It would also be simpler if no element
implements `__cmp__`.
In this ticket:
- make everything needed for rich comparisons available from Python (i.e.
`Py_EQ`, `Py_NE`, etc as well as `rich_to_bool/rich_to_bool_sgn`)
- we check the sage libraries for occurrences of
`__eq__`/`__ne__`/`__cmp__` in elements and see whether these can be
simplified
- #18303 takes care of `sage.rings.qqbar`
- update the documentation in `sage.structure.Element`
--
Ticket URL: <http://trac.sagemath.org/ticket/18305>
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.