diff options
Diffstat (limited to 'Lib/_pydecimal.py')
-rw-r--r-- | Lib/_pydecimal.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py index 88222be..05ba4ee 100644 --- a/Lib/_pydecimal.py +++ b/Lib/_pydecimal.py @@ -960,13 +960,12 @@ class Decimal(object): return self._cmp(other) >= 0 def compare(self, other, context=None): - """Compares one to another. + """Compare self to other. Return a decimal value: - -1 => a < b - 0 => a = b - 1 => a > b - NaN => one is NaN - Like __cmp__, but returns Decimal instances. + a or b is a NaN ==> Decimal('NaN') + a < b ==> Decimal('-1') + a == b ==> Decimal('0') + a > b ==> Decimal('1') """ other = _convert_other(other, raiseit=True) |