# HG changeset patch
# User Keshav Kini
# Date 1337907415 25200
# Node ID bc6aae82c09a61c7a056fe5c82ae285f8f1e94c7
# Parent 8eabc2db2cca52b7b89eedbe74392d4f8e22e84c
Let <= and >= return True when lhs == rhs
diff --git a/sage/plot/colors.py b/sage/plot/colors.py
--- a/sage/plot/colors.py
+++ b/sage/plot/colors.py
@@ -458,8 +458,9 @@
def __le__(self, right):
"""
Check whether a :class:`Color` object is less than or equal to
- some other object. This doesn't make sense, and so we conclude
- that it is not less than or equal to the other object.
+ some other object. It wouldn't make sense for it to be less than
+ the other object, so we treat this the same as an equality
+ check.
INPUT:
@@ -472,13 +473,13 @@
EXAMPLES::
sage: Color('red') <= Color('red')
- False
+ True
sage: Color('blue') <= Color('red')
False
sage: Color('red') <= "xyzzy"
False
"""
- return False
+ return self == right
def __eq__(self, right):
"""
@@ -564,9 +565,9 @@
def __ge__(self, right):
"""
Check whether a :class:`Color` object is greater than or equal
- to some other object. This doesn't make sense, and so we
- conclude that it is not greater than or equal to the other
- object.
+ to some other object. It wouldn't make sense for it to be
+ greater than the other object, so we treat this the same as an
+ equality check.
INPUT:
@@ -579,13 +580,13 @@
EXAMPLES::
sage: Color('red') >= Color('red')
- False
+ True
sage: Color('blue') >= Color('red')
False
sage: Color('red') >= "xyzzy"
False
"""
- return False
+ return self == right
def __hash__(self):
"""