From a1aab30e63c54185366786d9e3318639fe8b92c5 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Sun, 25 Feb 2018 21:23:29 +0000 Subject: [PATCH] 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 --- mitogen/core.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mitogen/core.py b/mitogen/core.py index d2d20723..8f633f1f 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -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, ())