core: Implement Dead.__ne__ & Dead.__hash__

Both these addtions are to address warnings in
https://lgtm.com/projects/g/dw/mitogen/alerts/?mode=list. Namely that if
a class defines an equality method then it should also define an
inequality and a hash method.

Refs #61
pull/95/head
Alex Willmer 7 years ago
parent 49d944340d
commit 7eb123595b

@ -121,9 +121,15 @@ class TimeoutError(Error):
class Dead(object): class Dead(object):
def __hash__(self):
return hash(Dead)
def __eq__(self, other): def __eq__(self, other):
return type(other) is Dead return type(other) is Dead
def __ne__(self, other):
return type(other) is not Dead
def __reduce__(self): def __reduce__(self):
return (_unpickle_dead, ()) return (_unpickle_dead, ())

Loading…
Cancel
Save