Skip to content

IncidenceStructure breaks if points cannot be sorted #26938

@jdemeyer

Description

@jdemeyer

This sort can fail if the points are not comparable:

                sortkey = lambda e: [(0 if x is None else 2 if isinstance(x, str) else 1, x) for x in e]\
                    if isinstance(e, tuple) else e
                self._points = sorted(points, key=sortkey)

The sortkey tries to find a clever way to "sort" the points but hardcoding classes like that is not a general solution. In particular, it's still comparing integers and strings when #22029 is appplied.

Instead, just don't sort.

CC: @vinklein

Component: combinatorics

Author: Jeroen Demeyer

Branch/Commit: a354dc1

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/26938

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions