Commit a1aab30e authored by Alex Willmer's avatar Alex Willmer Committed by David Wilson

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
parent 4b373c42
......@@ -121,9 +121,15 @@ class TimeoutError(Error):
class Dead(object):
def __hash__(self):
return hash(Dead)
def __eq__(self, other):
return type(other) is Dead
def __ne__(self, other):
return type(other) is not Dead
def __reduce__(self):
return (_unpickle_dead, ())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment