@@ -65,22 +65,22 @@ class Infinity(object):
65
65
""" provide a positive Infinity comparision method for ranking """
66
66
67
67
__lt__ = lambda self , other : False
68
- __le__ = lambda self , other : self is other
69
- __eq__ = lambda self , other : self is other
70
- __ne__ = lambda self , other : self is not other
71
- __gt__ = lambda self , other : self is not other
68
+ __le__ = lambda self , other : isinstance ( other, Infinity)
69
+ __eq__ = lambda self , other : isinstance ( other, Infinity)
70
+ __ne__ = lambda self , other : not isinstance ( other, Infinity)
71
+ __gt__ = lambda self , other : not isinstance ( other, Infinity)
72
72
__ge__ = lambda self , other : True
73
73
74
74
75
75
class NegInfinity (object ):
76
76
""" provide a negative Infinity comparision method for ranking """
77
77
78
- __lt__ = lambda self , other : self is not other
78
+ __lt__ = lambda self , other : not isinstance ( other, NegInfinity)
79
79
__le__ = lambda self , other : True
80
- __eq__ = lambda self , other : self is other
81
- __ne__ = lambda self , other : self is not other
80
+ __eq__ = lambda self , other : isinstance ( other, NegInfinity)
81
+ __ne__ = lambda self , other : not isinstance ( other, NegInfinity)
82
82
__gt__ = lambda self , other : False
83
- __ge__ = lambda self , other : self is other
83
+ __ge__ = lambda self , other : isinstance ( other, NegInfinity)
84
84
85
85
86
86
@ cython.wraparound (False )
0 commit comments