#14054: Cythoned UniqueRepresentation
-----------------------------------------------+----------------------------
Reporter: SimonKing | Owner: tbd
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-5.8
Component: performance | Resolution:
Keywords: cython UniqueRepresentation | Work issues: Fix
non-uniqueness trouble of combinatorial free modules
Report Upstream: N/A | Reviewers: Travis
Scrimshaw
Authors: Simon King | Merged in:
Dependencies: #14017, #6495 | Stopgaps:
-----------------------------------------------+----------------------------
Comment (by nbruin):
Very minor nitpick: I think providing `<=` and `>=` even for identical
inputs is not quite the correct thing to do. Python has objects for which
those are false or for which those raise an exception:
{{{
sage: a=float('NaN')
sage: a <= a
False
sage: b=complex(1,2)
sage: b<=b
TypeError: no ordering relation is defined for complex numbers
}}}
In python 3 this is even the default:
{{{
Python 3.2.3 (default, Jun 8 2012, 05:40:07)
[GCC 4.6.3 20120306 (Red Hat 4.6.3-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a=object()
>>> a<=a
TypeError: unorderable types: object() <= object()
>>> a==a
True
>>> a is a
True
}}}
I think not providing `(a <= a) == True` for `UniqueRepresentation` is
less likely to cause surprises in the future.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14054#comment:55>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.