summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-01-15 16:59:06 (GMT)
committerGuido van Rossum <guido@python.org>2007-01-15 16:59:06 (GMT)
commite2a383d062434c05b73031f0da57fe82b9da8942 (patch)
tree1a6fb6b2c056a10ee227dbc75855b3fac6153414 /Lib/decimal.py
parentfc7bb8c786fd9cb3b1ab84e1976620d0ab545777 (diff)
downloadcpython-e2a383d062434c05b73031f0da57fe82b9da8942.zip
cpython-e2a383d062434c05b73031f0da57fe82b9da8942.tar.gz
cpython-e2a383d062434c05b73031f0da57fe82b9da8942.tar.bz2
Rip out 'long' and 'L'-suffixed integer literals.
(Rough first cut.)
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r--Lib/decimal.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index 86455f3..f70e374 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -545,7 +545,7 @@ class Decimal(object):
return self
# From an integer
- if isinstance(value, (int,long)):
+ if isinstance(value, (int,int)):
if value >= 0:
self._sign = 0
else:
@@ -561,7 +561,7 @@ class Decimal(object):
if value[0] not in (0,1):
raise ValueError, 'Invalid sign'
for digit in value[1]:
- if not isinstance(digit, (int,long)) or digit < 0:
+ if not isinstance(digit, (int,int)) or digit < 0:
raise ValueError, "The second value in the tuple must be composed of non negative integer elements."
self._sign = value[0]
@@ -740,32 +740,32 @@ class Decimal(object):
return 1
def __eq__(self, other):
- if not isinstance(other, (Decimal, int, long)):
+ if not isinstance(other, (Decimal, int, int)):
return NotImplemented
return self.__cmp__(other) == 0
def __ne__(self, other):
- if not isinstance(other, (Decimal, int, long)):
+ if not isinstance(other, (Decimal, int, int)):
return NotImplemented
return self.__cmp__(other) != 0
def __lt__(self, other):
- if not isinstance(other, (Decimal, int, long)):
+ if not isinstance(other, (Decimal, int, int)):
return NotImplemented
return self.__cmp__(other) < 0
def __le__(self, other):
- if not isinstance(other, (Decimal, int, long)):
+ if not isinstance(other, (Decimal, int, int)):
return NotImplemented
return self.__cmp__(other) <= 0
def __gt__(self, other):
- if not isinstance(other, (Decimal, int, long)):
+ if not isinstance(other, (Decimal, int, int)):
return NotImplemented
return self.__cmp__(other) > 0
def __ge__(self, other):
- if not isinstance(other, (Decimal, int, long)):
+ if not isinstance(other, (Decimal, int, int)):
return NotImplemented
return self.__cmp__(other) >= 0
@@ -1529,7 +1529,7 @@ class Decimal(object):
Equivalent to long(int(self))
"""
- return long(self.__int__())
+ return int(self.__int__())
def _fix(self, context):
"""Round if it is necessary to keep self within prec precision.
@@ -2986,7 +2986,7 @@ def _convert_other(other):
"""
if isinstance(other, Decimal):
return other
- if isinstance(other, (int, long)):
+ if isinstance(other, (int, int)):
return Decimal(other)
return NotImplemented