Compare self to other. Return a decimal value: a or b is a NaN ==> Decimal('NaN') a < b ==> Decimal('-1') a == b ==> Decimal('0') a > b ==> Decimal('1')
(self, other, context=None)
| 933 | return self._cmp(other) >= 0 |
| 934 | |
| 935 | def compare(self, other, context=None): |
| 936 | """Compare self to other. Return a decimal value: |
| 937 | |
| 938 | a or b is a NaN ==> Decimal('NaN') |
| 939 | a < b ==> Decimal('-1') |
| 940 | a == b ==> Decimal('0') |
| 941 | a > b ==> Decimal('1') |
| 942 | """ |
| 943 | other = _convert_other(other, raiseit=True) |
| 944 | |
| 945 | # Compare(NaN, NaN) = NaN |
| 946 | if (self._is_special or other and other._is_special): |
| 947 | ans = self._check_nans(other, context) |
| 948 | if ans: |
| 949 | return ans |
| 950 | |
| 951 | return Decimal(self._cmp(other)) |
| 952 | |
| 953 | def __hash__(self): |
| 954 | """x.__hash__() <==> hash(x)""" |
no test coverage detected