]> granicus.if.org Git - python/commitdiff
More Python 2.3 compatibility fixes for decimal.py.
authorMark Dickinson <dickinsm@gmail.com>
Sun, 4 Jan 2009 21:22:02 +0000 (21:22 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sun, 4 Jan 2009 21:22:02 +0000 (21:22 +0000)
Lib/decimal.py

index 12dd7326cdac42caaba404751c4a105d96b4bb70..4140bea2f214bee00a37b5b853980f74c16aafab 100644 (file)
@@ -1556,13 +1556,13 @@ class Decimal(object):
 
     __trunc__ = __int__
 
-    @property
     def real(self):
         return self
+    real = property(real)
 
-    @property
     def imag(self):
         return Decimal(0)
+    imag = property(imag)
 
     def conjugate(self):
         return self
@@ -3174,7 +3174,7 @@ class Decimal(object):
         (opa, opb) = self._fill_logical(context, self._int, other._int)
 
         # 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)
 
     def logical_xor(self, other, context=None):
@@ -3188,7 +3188,7 @@ class Decimal(object):
         (opa, opb) = self._fill_logical(context, self._int, other._int)
 
         # 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)
 
     def max_mag(self, other, context=None):