Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix __cmp__ tests in sage/combinat/root_system/type_dual.py #12793

Closed
jdemeyer opened this issue Apr 2, 2012 · 4 comments
Closed

Fix __cmp__ tests in sage/combinat/root_system/type_dual.py #12793

jdemeyer opened this issue Apr 2, 2012 · 4 comments

Comments

@jdemeyer
Copy link

jdemeyer commented Apr 2, 2012

The following tests were added to sage/combinat/root_system/type_dual.py by #6588:

    def __cmp__(self, other):
        """
        EXAMPLES::

            sage: B4     = CartanType(['B', 4])
            sage: B4dual = CartanType(['B', 4]).dual()
            sage: F4dual = CartanType(['F', 4]).dual()
            sage: cmp(F4dual, F4dual)
            0
            sage: cmp(F4dual, B4dual)
            1
            sage: cmp(B4dual, F4dual)
            -1
            sage: cmp(B4dual, B4)
            1

        .. todo:: do we really need a cmp, or just eq?
        """

But whether cmp() outputs 1 or -1 is essentially arbitrary. This must be fixed immediately.

Component: combinatorics

Author: Jeroen Demeyer

Reviewer: Nicolas M. Thiéry

Merged: sage-5.0.beta12

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

@jdemeyer

This comment has been minimized.

@nthiery
Copy link
Contributor

nthiery commented Apr 2, 2012

comment:2

Attachment: 12793_type_dual_cmp.patch.gz

I just made a micro change to check that exchanging F4dual and B4dual inverses the sign.
If you are happy with it, you can set a positive review on my behalf.

Thanks for fixing my tests!

@nthiery
Copy link
Contributor

nthiery commented Apr 2, 2012

Reviewer: Nicolas M. Thiéry

@jdemeyer
Copy link
Author

jdemeyer commented Apr 3, 2012

Merged: sage-5.0.beta12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants