]> granicus.if.org Git - python/commitdiff
compare types with is not ==
authorBenjamin Peterson <benjamin@python.org>
Mon, 25 Jan 2010 03:58:21 +0000 (03:58 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 25 Jan 2010 03:58:21 +0000 (03:58 +0000)
Lib/decimal.py

index 51b87d9ed6d98030b064780d0aa4f7bc0baa5d0a..699ba5c6c5f1f84191fdb16e17a129e212ab4f76 100644 (file)
@@ -3517,12 +3517,12 @@ class Decimal(object):
         return (self.__class__, (str(self),))
 
     def __copy__(self):
-        if type(self) == Decimal:
+        if type(self) is Decimal:
             return self     # I'm immutable; therefore I am my own clone
         return self.__class__(str(self))
 
     def __deepcopy__(self, memo):
-        if type(self) == Decimal:
+        if type(self) is Decimal:
             return self     # My components are also immutable
         return self.__class__(str(self))