Opened 13 years ago
Closed 9 years ago
#6132 closed defect (duplicate)
[with patch, needs work] cmp for number field elements
Reported by: | robertwb | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | basic arithmetic | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
See discussion at http://groups.google.com/group/sage-nt/browse_thread/thread/422606e40805d5d0?hl=en
Note that cmp(list(a), list(b))
can be slow...
Attachments (1)
Change History (12)
comment:1 Changed 13 years ago by
Changed 13 years ago by
comment:2 Changed 13 years ago by
- Summary changed from cmp for number field elements to [with patch, needs review] cmp for number field elements
comment:3 Changed 13 years ago by
- Summary changed from [with patch, needs review] cmp for number field elements to [with patch, needs work] cmp for number field elements
The patch applies with some fuzz to 4.0.rc2, but I'm seeing a bunch of doctest failures in sage/rings:
The following tests failed: sage -t "devel/sage-main/sage/rings/number_field/number_field.py" sage -t "devel/sage-main/sage/rings/number_field/number_field_rel.py" sage -t "devel/sage-main/sage/rings/number_field/order.py" sage -t "devel/sage-main/sage/rings/number_field/galois_group.py" sage -t "devel/sage-main/sage/rings/number_field/number_field_element.pyx" sage -t "devel/sage-main/sage/rings/number_field/number_field_ideal.py" sage -t "devel/sage-main/sage/rings/number_field/number_field_ideal_rel.py" sage -t "devel/sage-main/sage/rings/number_field/unit_group.py" sage -t "devel/sage-main/sage/rings/polynomial/complex_roots.py" sage -t "devel/sage-main/sage/rings/polynomial/polynomial_element.pyx"
comment:4 Changed 13 years ago by
- Owner changed from somebody to nbruin
- Report Upstream set to N/A
In Python 3, "greater than" etc. comparisons between objects where no natural ordering exist are supposed to raise a "TypeError?"
Already, comparing complex numbers in Python 2.6.2 raises
TypeError: no ordering relation is defined for complex numbers
Changing this will probably lead to even more doctest failures, but brings us closer to Python's way of doing things and to mathematical sanity.
comment:5 Changed 13 years ago by
- Owner changed from nbruin to (none)
comment:6 Changed 13 years ago by
Note that to follow this convention, we have to use richcmp as == and != should still work for unordered elements.
comment:7 Changed 12 years ago by
Apparently related to #7160 and #10064, see this sage-devel discussion.
comment:8 follow-up: ↓ 9 Changed 11 years ago by
See also #9572.
comment:9 in reply to: ↑ 8 Changed 11 years ago by
comment:10 Changed 11 years ago by
See #7160 for a related ticket/discussion.
comment:11 Changed 9 years ago by
- Milestone changed from sage-5.11 to sage-duplicate/invalid/wontfix
- Resolution set to duplicate
- Status changed from needs_work to closed
I think we can close this as a duplicate of those other tickets now that they are merged.
Minor, but I just fixed two of these elsewhere: it's spelled "consistent"