diff --git a/gallery_dl/util.py b/gallery_dl/util.py index 2f17dc21..5744ef32 100644 --- a/gallery_dl/util.py +++ b/gallery_dl/util.py @@ -540,10 +540,14 @@ class CustomNone(): def __bool__(): return False + def __eq__(self, other): + return self is other + + def __ne__(self, other): + return self is not other + __lt__ = true __le__ = true - __eq__ = false - __ne__ = true __gt__ = false __ge__ = false diff --git a/test/test_util.py b/test/test_util.py index dba54bba..4622c286 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -755,8 +755,9 @@ def hash(value): self.assertLess(obj, "foo") self.assertLessEqual(obj, None) - self.assertFalse(obj == obj) - self.assertTrue(obj != obj) + self.assertTrue(obj == obj) + self.assertFalse(obj == 0) + self.assertFalse(obj != obj) self.assertGreater(123, obj) self.assertGreaterEqual(1.23, obj)