raise TypeError('unorderable types: {}() < {}()'.format(self.__class__.__name__,
other.__class__.__name__))
- return self._value < float(other)
+ return self._value < self._extract_value(other)
def _spec_eq(self, other):
if not isinstance(other, numbers.Number):
return NotImplemented
- return self._value == complex(other)
+ return self._value == self._extract_value(other)
def __rmod__(self, other):
return self._extract_value(other) % self._value
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 _spec_eq(self, other):
- if not isinstance(other, numbers.Integral):
- return super()._spec_eq(other);
-
- return self._value == int(other)
-
class _IntegerField(_IntegralField, _Field):
pass
raise TypeError('unorderable types: {}() < {}()'.format(self.__class__.__name__,
other.__class__.__name__))
- return self._value < float(other)
+ return self._value < self._extract_value(other)
def _spec_eq(self, other):
pass
if not isinstance(other, numbers.Number):
return False
- return self._value == complex(other)
+ return self._value == self._extract_value(other)
def __rmod__(self, other):
return self._extract_value(other) % self._value
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