summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-05-03 21:05:51 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-05-03 21:05:51 (GMT)
commitaa97f0496412ed834aada921e29588ed16d68e40 (patch)
treecfe74cb3cd3ed5a27cbcfa404ea9fc8c73fd63f1 /Lib/decimal.py
parent5d7a7001d9df605606b249b3e11707d6d1ad2e3d (diff)
downloadcpython-aa97f0496412ed834aada921e29588ed16d68e40.zip
cpython-aa97f0496412ed834aada921e29588ed16d68e40.tar.gz
cpython-aa97f0496412ed834aada921e29588ed16d68e40.tar.bz2
Fix various spots where int/long and str/unicode unification
lead to type checks like isinstance(foo, (str, str)) or isinstance(foo, (int, int)).
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r--Lib/decimal.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index a7238e1..2611f79 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -741,32 +741,32 @@ class Decimal(object):
return 1
def __eq__(self, other):
- if not isinstance(other, (Decimal, int, int)):
+ if not isinstance(other, (Decimal, int)):
return NotImplemented
return self.__cmp__(other) == 0
def __ne__(self, other):
- if not isinstance(other, (Decimal, int, int)):
+ if not isinstance(other, (Decimal, int)):
return NotImplemented
return self.__cmp__(other) != 0
def __lt__(self, other):
- if not isinstance(other, (Decimal, int, int)):
+ if not isinstance(other, (Decimal, int)):
return NotImplemented
return self.__cmp__(other) < 0
def __le__(self, other):
- if not isinstance(other, (Decimal, int, int)):
+ if not isinstance(other, (Decimal, int)):
return NotImplemented
return self.__cmp__(other) <= 0
def __gt__(self, other):
- if not isinstance(other, (Decimal, int, int)):
+ if not isinstance(other, (Decimal, int)):
return NotImplemented
return self.__cmp__(other) > 0
def __ge__(self, other):
- if not isinstance(other, (Decimal, int, int)):
+ if not isinstance(other, (Decimal, int)):
return NotImplemented
return self.__cmp__(other) >= 0
@@ -2993,7 +2993,7 @@ def _convert_other(other):
"""
if isinstance(other, Decimal):
return other
- if isinstance(other, (int, int)):
+ if isinstance(other, int):
return Decimal(other)
return NotImplemented