From 28e369a8f8a5fe416159a2a5604321574ea148b3 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 25 Jan 2010 03:58:21 +0000 Subject: [PATCH] compare types with is not == --- Lib/decimal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/decimal.py b/Lib/decimal.py index 51b87d9ed6d..699ba5c6c5f 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))