summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-03-12 19:56:08 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-03-12 19:56:08 (GMT)
commita60c2fe4807e89a5844979fe46b3ea39572fc3be (patch)
tree0177eec0d55bb6325897ed7a19db9dad2e5df304 /Lib/decimal.py
parent18987a11ce0f8f55aa6ec63a9d2f8e84d7460984 (diff)
downloadcpython-a60c2fe4807e89a5844979fe46b3ea39572fc3be.zip
cpython-a60c2fe4807e89a5844979fe46b3ea39572fc3be.tar.gz
cpython-a60c2fe4807e89a5844979fe46b3ea39572fc3be.tar.bz2
Issue #23641: Cleaned out legacy dunder names from tests and docs.
Fixed 2 to 3 porting bug in pynche.ColorDB.
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r--Lib/decimal.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index b254f9c..324e4f9 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -967,13 +967,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)