Ticket #12793: 12793_type_dual_cmp.patch

File 12793_type_dual_cmp.patch, 1.2 KB (added by nthiery, 4 years ago)
  • sage/combinat/root_system/type_dual.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1333379973 -7200
    # Node ID f7da924ee520a415895881fccc823507e288f1a2
    # Parent  7bb540c65f7caa83e55b4518e50c42ee489f4d39
    Fix __cmp__ tests
    
    diff --git a/sage/combinat/root_system/type_dual.py b/sage/combinat/root_system/type_dual.py
    a b  
    131131            sage: F4dual = CartanType(['F', 4]).dual()
    132132            sage: cmp(F4dual, F4dual)
    133133            0
    134             sage: cmp(F4dual, B4dual)
    135             1
    136             sage: cmp(B4dual, F4dual)
    137             -1
    138             sage: cmp(B4dual, B4)
    139             1
    140134
    141         .. todo:: do we really need a cmp, or just eq?
     135        Whether ``cmp()`` returns 1 or -1 doesn't matter, just check
     136        that the following are non-zero::
     137
     138            sage: cmp(F4dual, B4dual) != 0
     139            True
     140            sage: cmp(B4dual, F4dual) * cmp(F4dual, B4dual) < 0
     141            True
     142            sage: cmp(B4dual, B4) != 0
     143            True
    142144        """
    143145        if other.__class__ != self.__class__:
    144146            return cmp(self.__class__, other.__class__)