compare types with is not ==

This commit is contained in:
Benjamin Peterson 2010-01-25 03:58:21 +00:00
parent a617e208fc
commit 28e369a8f8
1 changed files with 2 additions and 2 deletions

View 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))