Closed
Description
Description
In getSolutionIter, a list of 3-tuples is sorted, where the 3rd tuple item is a problem variable index. This throws a TypeError when the type(s) of variable indices are incomparable. There is no reason to assume a variable ID to be comparable, only identity (hashability) should be assumed.
Proposed solution
Only sort by the first two tuple items (which seems to be the intended logic).
In getSolutionIter change:
lst.sort() ----> lst.sort(key=lambda x: (x[0], x[1]))
Alternatively, if comparability is required by the programme logic, specify it in documentation and ideally via typing.
Library version: 2.2.1
Python: 3.12.5
Metadata
Metadata
Assignees
Labels
No labels