Opened 4 years ago

Last modified 4 years ago

#26931 closed defect

Predictable sorting in — at Version 1

Reported by: Jeroen Demeyer Owned by:
Priority: major Milestone: sage-8.6
Component: python3 Keywords:
Cc: John Palmieri Merged in:
Authors: Jeroen Demeyer Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Jeroen Demeyer)

#25932 introduced code of the form

    vertices = tuple(sorted(vertex_set))
except TypeError:
    vertices = tuple(sorted(vertex_set, key=str))

The problem here is that sorting is not predictable: adding a vertex or considering a subset of vertices could suddenly change the sorting.

Instead, the sorting key should be explicitly given and the same key should always be used for the same simplicial complex.

Change History (1)

comment:1 Changed 4 years ago by Jeroen Demeyer

Description: modified (diff)
Note: See TracTickets for help on using tickets.