mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 20:22:36 +01:00
[util] let a CustomNone instance be equal to itself
This commit is contained in:
parent
8ecd408f53
commit
d7a2c73274
@ -540,10 +540,14 @@ class CustomNone():
|
|||||||
def __bool__():
|
def __bool__():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
return self is other
|
||||||
|
|
||||||
|
def __ne__(self, other):
|
||||||
|
return self is not other
|
||||||
|
|
||||||
__lt__ = true
|
__lt__ = true
|
||||||
__le__ = true
|
__le__ = true
|
||||||
__eq__ = false
|
|
||||||
__ne__ = true
|
|
||||||
__gt__ = false
|
__gt__ = false
|
||||||
__ge__ = false
|
__ge__ = false
|
||||||
|
|
||||||
|
@ -755,8 +755,9 @@ def hash(value):
|
|||||||
|
|
||||||
self.assertLess(obj, "foo")
|
self.assertLess(obj, "foo")
|
||||||
self.assertLessEqual(obj, None)
|
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.assertGreater(123, obj)
|
||||||
self.assertGreaterEqual(1.23, obj)
|
self.assertGreaterEqual(1.23, obj)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user