Opened 2 years ago
Closed 2 years ago
#23590 closed defect (wontfix)
Matching comparison behavior between Integers and ints
Reported by: | roed | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | python3 | Keywords: | |
Cc: | Stefan | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
The following has changed since Sage 7.2.
sage: sorted([1,2,'a']) ['a', 1, 2] sage: sorted([1r,2r,'a']) [1, 2, 'a']
I think that these should have the same result (matching the Python int
behavior, since we can change Integer
comparison more easily).
Change History (5)
comment:1 Changed 2 years ago by
- Cc Stefan added
comment:2 Changed 2 years ago by
comment:3 Changed 2 years ago by
Yes, but we aren't on Python 3 yet, so it's still changed behavior compared to the past for the current version of Sage.
comment:4 Changed 2 years ago by
I'm mostly with Frédéric on this one. I don't think it is worth spending time worrying about how int
and Integer
compare with strings (well...hopefully Integer
will be consistent with int
when we go to Python3). Actually, I believe it is random for int
and str
as it is based on memory location, but I could be wrong (at least I cannot get a test to (dis)prove it).
comment:5 Changed 2 years ago by
- Milestone changed from sage-8.1 to sage-duplicate/invalid/wontfix
- Resolution set to wontfix
- Status changed from new to closed
+1, this comparison is pointless anyway.