mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
More Python 2.3 compatibility fixes for decimal.py.
This commit is contained in:
parent
6a961637a8
commit
65808ff0c0
1 changed files with 4 additions and 4 deletions
|
@ -1556,13 +1556,13 @@ class Decimal(object):
|
||||||
|
|
||||||
__trunc__ = __int__
|
__trunc__ = __int__
|
||||||
|
|
||||||
@property
|
|
||||||
def real(self):
|
def real(self):
|
||||||
return self
|
return self
|
||||||
|
real = property(real)
|
||||||
|
|
||||||
@property
|
|
||||||
def imag(self):
|
def imag(self):
|
||||||
return Decimal(0)
|
return Decimal(0)
|
||||||
|
imag = property(imag)
|
||||||
|
|
||||||
def conjugate(self):
|
def conjugate(self):
|
||||||
return self
|
return self
|
||||||
|
@ -3174,7 +3174,7 @@ class Decimal(object):
|
||||||
(opa, opb) = self._fill_logical(context, self._int, other._int)
|
(opa, opb) = self._fill_logical(context, self._int, other._int)
|
||||||
|
|
||||||
# make the operation, and clean starting zeroes
|
# make the operation, and clean starting zeroes
|
||||||
result = "".join(str(int(a)|int(b)) for a,b in zip(opa,opb))
|
result = "".join([str(int(a)|int(b)) for a,b in zip(opa,opb)])
|
||||||
return _dec_from_triple(0, result.lstrip('0') or '0', 0)
|
return _dec_from_triple(0, result.lstrip('0') or '0', 0)
|
||||||
|
|
||||||
def logical_xor(self, other, context=None):
|
def logical_xor(self, other, context=None):
|
||||||
|
@ -3188,7 +3188,7 @@ class Decimal(object):
|
||||||
(opa, opb) = self._fill_logical(context, self._int, other._int)
|
(opa, opb) = self._fill_logical(context, self._int, other._int)
|
||||||
|
|
||||||
# make the operation, and clean starting zeroes
|
# make the operation, and clean starting zeroes
|
||||||
result = "".join(str(int(a)^int(b)) for a,b in zip(opa,opb))
|
result = "".join([str(int(a)^int(b)) for a,b in zip(opa,opb)])
|
||||||
return _dec_from_triple(0, result.lstrip('0') or '0', 0)
|
return _dec_from_triple(0, result.lstrip('0') or '0', 0)
|
||||||
|
|
||||||
def max_mag(self, other, context=None):
|
def max_mag(self, other, context=None):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue