summaryrefslogtreecommitdiffstats
path: root/Lib/_pydecimal.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-03-12 20:01:30 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-03-12 20:01:30 (GMT)
commitc2ccce791ccbe35bee0edea2dedabb0fc7ea5906 (patch)
treec31fcb2d158d17ab07038f26ec016b37e5b8cea0 /Lib/_pydecimal.py
parentda0870c87aeb7843f0211d3fd9220f6f5b58f688 (diff)
parenta60c2fe4807e89a5844979fe46b3ea39572fc3be (diff)
downloadcpython-c2ccce791ccbe35bee0edea2dedabb0fc7ea5906.zip
cpython-c2ccce791ccbe35bee0edea2dedabb0fc7ea5906.tar.gz
cpython-c2ccce791ccbe35bee0edea2dedabb0fc7ea5906.tar.bz2
Issue #23641: Cleaned out legacy dunder names from tests and docs.
Fixed 2 to 3 porting bug in pynche.ColorDB. Added few tests for __truediv__, __floordiv__ and __matmul__.
Diffstat (limited to 'Lib/_pydecimal.py')
-rw-r--r--Lib/_pydecimal.py11
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)