From: Benjamin Peterson Date: Mon, 25 Jan 2010 03:58:21 +0000 (+0000) Subject: compare types with is not == X-Git-Tag: v2.7a3~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28e369a8f8a5fe416159a2a5604321574ea148b3;p=python compare types with is not == --- diff --git a/Lib/decimal.py b/Lib/decimal.py index 51b87d9ed6..699ba5c6c5 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -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))