Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#9121 closed defect (fixed)

sage-4.4.3.alpha1: set.py doctest failure

Reported by: William Stein Owned by: tbd
Priority: blocker Milestone: sage-4.4.3
Component: doctest coverage Keywords: Sets comparison
Cc: Merged in: sage-4.4.3.alpha3
Authors: William Stein Reviewers: Florent Hivert
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by William Stein)

This test now fails in set.py:

            sage: Primes() < Set(QQ)
            True

Attachments (2)

trac_9121.patch (839 bytes) - added by William Stein 13 years ago.
trac_9121-part2.patch (1.4 KB) - added by William Stein 13 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 13 years ago by William Stein

Description: modified (diff)
Status: newneeds_review

I noticed a bug while looking at the relevant code in cmp:

        if not isinstance(right, Set_object):
            return cmp(type(right), type(Set_object))
        return cmp(self.__object, right.__object)

Notice that the first compare is totally backwards! Interestingly, fixing this does fix the above bug. Patch attached.

Changed 13 years ago by William Stein

Attachment: trac_9121.patch added

comment:2 Changed 13 years ago by François Bissey

I actually reported http://trac.sagemath.org/sage_trac/ticket/9004 on that expression - the test has failed for a long time on sage-on-gentoo. I didn't notice the backwardness and did something slightly different, but the backwardness explain a lot of things. I think you should have a look at it and mark one of them a duplicate.

comment:3 Changed 13 years ago by William Stein

Milestone: sage-4.4.4sage-4.4.3

Changed 13 years ago by William Stein

Attachment: trac_9121-part2.patch added

comment:4 Changed 13 years ago by William Stein

fbissey -- you're right. Both of our patches are wrong, but together they are right.

Note that I'm marking this test random, since it is a comparison of types, which is architecture and sage-version dependent.

comment:5 in reply to:  4 Changed 13 years ago by Florent Hivert

Replying to was:

fbissey -- you're right. Both of our patches are wrong, but together they are right.

Note that I'm marking this test random, since it is a comparison of types, which is architecture and sage-version dependent.

Note : trac_9121.patch was already merged in sage-4.4.3.alpha1 only trac_9121-part2.patch needs to be merged... The patch looks good to me I'm waiting for the tests to finish.

comment:6 Changed 13 years ago by Florent Hivert

Authors: William Stein
Keywords: Sets comparison added
Reviewers: Florent Hivert
Status: needs_reviewpositive_review

All tests passed!

comment:7 Changed 13 years ago by William Stein

Merged in: 4.4.3.alpha3
Resolution: fixed
Status: positive_reviewclosed

comment:8 Changed 13 years ago by Minh Van Nguyen

Merged in: 4.4.3.alpha3sage-4.4.3.alpha3
Note: See TracTickets for help on using tickets.