diff options
Diffstat (limited to 'taskflow')
-rw-r--r-- | taskflow/engines/worker_based/types.py | 3 | ||||
-rw-r--r-- | taskflow/jobs/backends/impl_redis.py | 3 | ||||
-rw-r--r-- | taskflow/jobs/backends/impl_zookeeper.py | 3 | ||||
-rw-r--r-- | taskflow/storage.py | 3 | ||||
-rw-r--r-- | taskflow/tests/utils.py | 3 | ||||
-rw-r--r-- | taskflow/types/notifier.py | 3 |
6 files changed, 18 insertions, 0 deletions
diff --git a/taskflow/engines/worker_based/types.py b/taskflow/engines/worker_based/types.py index 9b660b5..b2334a3 100644 --- a/taskflow/engines/worker_based/types.py +++ b/taskflow/engines/worker_based/types.py @@ -67,6 +67,9 @@ class TopicWorker(object): else: return other.identity == self.identity + def __ne__(self, other): + return not self.__eq__(other) + def __repr__(self): r = reflection.get_class_name(self, fully_qualified=False) if self.identity is not self._NO_IDENTITY: diff --git a/taskflow/jobs/backends/impl_redis.py b/taskflow/jobs/backends/impl_redis.py index e24c174..cd141e2 100644 --- a/taskflow/jobs/backends/impl_redis.py +++ b/taskflow/jobs/backends/impl_redis.py @@ -156,6 +156,9 @@ class RedisJob(base.Job): return ((self.board.listings_key, self.priority, self.sequence) == (other.board.listings_key, other.priority, other.sequence)) + def __ne__(self, other): + return not self.__eq__(other) + def __hash__(self): return hash((self.board.listings_key, self.priority, self.sequence)) diff --git a/taskflow/jobs/backends/impl_zookeeper.py b/taskflow/jobs/backends/impl_zookeeper.py index 5a446cb..3c83d8a 100644 --- a/taskflow/jobs/backends/impl_zookeeper.py +++ b/taskflow/jobs/backends/impl_zookeeper.py @@ -201,6 +201,9 @@ class ZookeeperJob(base.Job): return ((self.root, self.sequence, self.priority) == (other.root, other.sequence, other.priority)) + def __ne__(self, other): + return not self.__eq__(other) + def __hash__(self): return hash(self.path) diff --git a/taskflow/storage.py b/taskflow/storage.py index 15edb19..be52774 100644 --- a/taskflow/storage.py +++ b/taskflow/storage.py @@ -231,6 +231,9 @@ class _Provider(object): def __eq__(self, other): return (self.name, self.index) == (other.name, other.index) + def __ne__(self, other): + return not self.__eq__(other) + def _item_from(container, index): """Attempts to fetch a index/key from a given container.""" diff --git a/taskflow/tests/utils.py b/taskflow/tests/utils.py index ed4d4e9..471da9b 100644 --- a/taskflow/tests/utils.py +++ b/taskflow/tests/utils.py @@ -375,6 +375,9 @@ class FailureMatcher(object): def __eq__(self, other): return self._failure.matches(other) + def __ne__(self, other): + return not self.__eq__(other) + class OneReturnRetry(retry.AlwaysRevert): diff --git a/taskflow/types/notifier.py b/taskflow/types/notifier.py index b81d255..c91cea1 100644 --- a/taskflow/types/notifier.py +++ b/taskflow/types/notifier.py @@ -123,6 +123,9 @@ class Listener(object): else: return NotImplemented + def __ne__(self, other): + return not self.__eq__(other) + class Notifier(object): """A notification (`pub/sub`_ *like*) helper class. |