return self._value < float(other)
- def __le__(self, other):
- if not isinstance(other, numbers.Number):
- raise TypeError('unorderable types: {}() <= {}()'.format(self.__class__.__name__,
- other.__class__.__name__))
-
- return self._value <= float(other)
-
def _spec_eq(self, other):
pass
self.value = self | other
return self
+ def __lt__(self, other):
+ if not isinstance(other, numbers.Integral):
+ return super().__lt__(other)
+
+ return self._value < int(other)
+
+ def __eq__(self, other):
+ if not isinstance(other, numbers.Integral):
+ return super().__eq__(other)
+
+ return self._value == int(other)
+
class _RealValue(_NumericValue, numbers.Real):
pass
except:
return
- def __le__(self, other):
- return self._value <= self._value_to_str(other)
-
def __lt__(self, other):
return self._value < self._value_to_str(other)