Fix various spots where int/long and str/unicode unification
lead to type checks like isinstance(foo, (str, str)) or
isinstance(foo, (int, int)).
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 @@
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 @@
"""
if isinstance(other, Decimal):
return other
- if isinstance(other, (int, int)):
+ if isinstance(other, int):
return Decimal(other)
return NotImplemented