Use dict.values() instead of dict.items() where possible

(suggested in @spulec review)
This commit is contained in:
Jean-Baptiste Barth 2015-11-18 22:00:57 +01:00
parent de646cf7ac
commit 5f0684fca5
2 changed files with 6 additions and 6 deletions

View File

@ -113,7 +113,7 @@ class SWFBackend(BaseBackend):
self._check_string(domain_name)
self._check_string(name)
self._check_string(version)
for _, value in kwargs.items():
for value in kwargs.values():
self._check_none_or_string(value)
domain = self._get_domain(domain_name)
_type = domain.get_type(kind, name, version, ignore_empty=True)
@ -148,7 +148,7 @@ class SWFBackend(BaseBackend):
self._check_string(workflow_name)
self._check_string(workflow_version)
self._check_none_or_list_of_strings(tag_list)
for _, value in kwargs.items():
for value in kwargs.values():
self._check_none_or_string(value)
domain = self._get_domain(domain_name)

View File

@ -63,8 +63,8 @@ class Domain(object):
def find_types(self, kind, status):
_all = []
for _, family in self.types[kind].items():
for _, _type in family.items():
for family in self.types[kind].values():
for _type in family.values():
if _type.status == status:
_all.append(_type)
return _all
@ -107,7 +107,7 @@ class Domain(object):
@property
def activity_tasks(self):
_all = []
for _, tasks in self.activity_task_lists.items():
for tasks in self.activity_task_lists.values():
_all += tasks
return _all
@ -119,6 +119,6 @@ class Domain(object):
@property
def decision_tasks(self):
_all = []
for _, tasks in self.decision_task_lists.items():
for tasks in self.decision_task_lists.values():
_all += tasks
return _all