Opened 14 years ago
Closed 13 years ago
#729 closed task (duplicate)
[is duplicate?] graphs: Implement __eq__ and __neq__ rather than __cmp__
Reported by: | jason | Owned by: | was |
---|---|---|---|
Priority: | trivial | Milestone: | sage-2.8.9 |
Component: | combinatorics | Keywords: | graphs |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
The rich comparison operators eq and neq are preferred in Python. See http://docs.python.org/ref/customization.html
Change History (7)
comment:1 Changed 14 years ago by
- Milestone set to sage-2.9
comment:2 Changed 13 years ago by
- Resolution set to invalid
- Status changed from new to closed
comment:3 Changed 13 years ago by
- Milestone changed from sage-2.9 to sage-2.8.9
Please do not close tickets unless explicitly asked to do so. You can recommend to close a ticket.
Cheers,
Michael
comment:4 Changed 13 years ago by
- Resolution invalid deleted
- Status changed from closed to reopened
comment:5 Changed 13 years ago by
- Summary changed from graphs: Implement __eq__ and __neq__ rather than __cmp__ to [is invalid] graphs: Implement __eq__ and __neq__ rather than __cmp__
comment:6 Changed 13 years ago by
- Summary changed from [is invalid] graphs: Implement __eq__ and __neq__ rather than __cmp__ to [is duplicate?] graphs: Implement __eq__ and __neq__ rather than __cmp__
Actually, I was wrong on two counts - count 1, the graph_isom code actually re-implements the enumeration, so it doesn't actually depend on cmp, and count 2, you're right about rich comparison, but instead of just eq and neq, there should also be lt, le, etc. However, this would all be part of an overhaul on how graph enumeration is done in general, so this could be part of ticket #749.
comment:7 Changed 13 years ago by
- Resolution set to duplicate
- Status changed from reopened to closed
This is duplicate because #749 takes care of it.
This is actually crucial in the graph_isom code: there, not just equality comparison, but actually finding which graph is smaller is important. There is a specific enumeration of graphs coded, and under that enumeration, cmp gives exactly what it means. This method cannot be removed.