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(domain_name)
self._check_string(name) self._check_string(name)
self._check_string(version) self._check_string(version)
for _, value in kwargs.items(): for value in kwargs.values():
self._check_none_or_string(value) self._check_none_or_string(value)
domain = self._get_domain(domain_name) domain = self._get_domain(domain_name)
_type = domain.get_type(kind, name, version, ignore_empty=True) _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_name)
self._check_string(workflow_version) self._check_string(workflow_version)
self._check_none_or_list_of_strings(tag_list) 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) self._check_none_or_string(value)
domain = self._get_domain(domain_name) domain = self._get_domain(domain_name)

View File

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