use isinstance() instead of type()

This commit is contained in:
Michael James 2018-10-11 20:33:53 -06:00
parent 8710fc8fc9
commit 6d98ecc782

View file

@ -93,7 +93,7 @@ class Level(object):
return False
def __le__(self, other):
if type(self) != type(other):
if not isinstance(self, other):
return NotImplemented
elif self.masterLevel.getName() != other.masterLevel.getName():
return NotImplemented
@ -101,7 +101,7 @@ class Level(object):
return self.__lt__(other) or self.__eq__(other)
def __gt__(self, other):
if type(self) != type(other):
if not isinstance(self, other):
return NotImplemented
elif self.masterLevel.getName() != other.masterLevel.getName():
return NotImplemented
@ -133,7 +133,7 @@ class Level(object):
return False
def __ge__(self, other):
if type(self) != type(other):
if not isinstance(self, other):
return NotImplemented
elif self.masterLevel.getName() != other.masterLevel.getName():
return NotImplemented