NamedInt: return False on comparison with None
This commit is contained in:
parent
7706882a27
commit
636bb07d1f
|
@ -44,6 +44,8 @@ class NamedInt(int):
|
|||
return int2bytes(self, count)
|
||||
|
||||
def __eq__(self, other):
|
||||
if other is None:
|
||||
return False
|
||||
if isinstance(other, NamedInt):
|
||||
return int(self) == int(other) and self.name == other.name
|
||||
if isinstance(other, int):
|
||||
|
|
Loading…
Reference in New Issue