mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
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__.
This commit is contained in:
commit
c2ccce791c
19 changed files with 86 additions and 124 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue