Opened 2 years ago

Closed 2 years ago

#26948 closed defect (duplicate)

SetPartition breaks with unsortable input

Reported by: jdemeyer Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: combinatorics Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

With #22029:

**********************************************************************
File "src/sage/combinat/set_partition.py", line 701, in sage.combinat.set_partition.SetPartition._latex_
Failed example:
    p = SetPartition([['a','c'],['b',1],[20]])
Exception raised:
    Traceback (most recent call last):
      File "/opt/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 671, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/opt/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1086, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.combinat.set_partition.SetPartition._latex_[4]>", line 1, in <module>
        p = SetPartition([['a','c'],['b',Integer(1)],[Integer(20)]])
      File "sage/misc/classcall_metaclass.pyx", line 330, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1701)
        return cls.classcall(cls, *args, **kwds)
      File "/opt/sage/local/lib/python2.7/site-packages/sage/combinat/set_partition.py", line 537, in __classcall_private__
        return P.element_class(P, parts, check=check)
      File "sage/misc/classcall_metaclass.pyx", line 333, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1726)
        return (<PyTypeObject*>type).tp_call(cls, args, kwds)
      File "/opt/sage/local/lib/python2.7/site-packages/sage/combinat/set_partition.py", line 556, in __init__
        ClonableArray.__init__(self, parent, sorted(map(frozenset, s), key=min), check=check)
      File "sage/rings/integer.pyx", line 952, in sage.rings.integer.Integer.__richcmp__ (build/cythonized/sage/rings/integer.c:7787)
        return coercion_model.richcmp(left, right, op)
      File "sage/structure/coerce.pyx", line 1992, in sage.structure.coerce.CoercionModel_cache_maps.richcmp (build/cythonized/sage/structure/coerce.c:20111)
        raise bin_op_exception('>', x, y)
    TypeError: unsupported operand parent(s) for >: 'Integer Ring' and '<type 'str'>'
**********************************************************************

Change History (2)

comment:1 Changed 2 years ago by mantepse

this is essentially a duplicate of #26917

comment:2 Changed 2 years ago by jdemeyer

  • Milestone changed from sage-8.6 to sage-duplicate/invalid/wontfix
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.