From 5f0684fca5668d24fdb7b223b368de3c0607cb76 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Barth Date: Wed, 18 Nov 2015 22:00:57 +0100 Subject: [PATCH] Use dict.values() instead of dict.items() where possible (suggested in @spulec review) --- moto/swf/models/__init__.py | 4 ++-- moto/swf/models/domain.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/moto/swf/models/__init__.py b/moto/swf/models/__init__.py index f4fe246f8..b9d7be0fd 100644 --- a/moto/swf/models/__init__.py +++ b/moto/swf/models/__init__.py @@ -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) diff --git a/moto/swf/models/domain.py b/moto/swf/models/domain.py index 824782c59..98892a30b 100644 --- a/moto/swf/models/domain.py +++ b/moto/swf/models/domain.py @@ -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