From 9282d3a944f91dbfc1d66fcc62affa6b32f737bc Mon Sep 17 00:00:00 2001 From: Changbin Liu Date: Mon, 29 Jul 2013 18:57:59 -0400 Subject: [PATCH] Fix minor code style Change-Id: Ib051581cd820cbb478b95b1b4421adb2b577567d --- taskflow/backends/memory.py | 4 +--- taskflow/patterns/base.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/taskflow/backends/memory.py b/taskflow/backends/memory.py index f006e310..8d8b778b 100644 --- a/taskflow/backends/memory.py +++ b/taskflow/backends/memory.py @@ -154,9 +154,7 @@ class MemoryLogBook(logbook.LogBook): @check_not_closed def __contains__(self, flow_name): - if flow_name not in self._flow_names: - return False - return True + return flow_name in self._flow_names def __delitem__(self, flow_name): w = self[flow_name] diff --git a/taskflow/patterns/base.py b/taskflow/patterns/base.py index a4756e0d..14d6aa5d 100644 --- a/taskflow/patterns/base.py +++ b/taskflow/patterns/base.py @@ -59,7 +59,7 @@ class Flow(object): if parents: self.parents = tuple(parents) else: - self.parents = tuple([]) + self.parents = () # Any objects that want to listen when a wf/task starts/stops/completes # or errors should be registered here. This can be used to monitor # progress and record tasks finishing (so that it becomes possible to