From c5c0654d194a165196cb5b31c6c3b1e07620e98a Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Tue, 23 Oct 2018 16:27:40 +0100 Subject: element.py: Simplify some conditions with `in (foo, bar)` Where we have conditions of the form `var == foo or var == bar` it can be simplified to `var in (foo, bar)` which pylint prefers. Signed-off-by: Daniel Silverstone --- buildstream/element.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildstream/element.py b/buildstream/element.py index de1988d2a..baf0be3f5 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -432,7 +432,7 @@ class Element(Plugin): visited=visited, recursed=True) # Yeild self only at the end, after anything needed has been traversed - if should_yield and (recurse or recursed) and (scope == Scope.ALL or scope == Scope.RUN): + if should_yield and (recurse or recursed) and (scope in (Scope.ALL, Scope.RUN)): yield self def search(self, scope, name): @@ -2521,7 +2521,7 @@ class Element(Plugin): strong_key = meta['strong'] weak_key = meta['weak'] - assert key == strong_key or key == weak_key + assert key in (strong_key, weak_key) self.__metadata_keys[strong_key] = meta self.__metadata_keys[weak_key] = meta -- cgit v1.2.1