From a1bb3eb0a5a1ffde5fd0a8621c32b31ef6a3c4fb Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Wed, 26 Nov 2014 12:20:40 -0600 Subject: [PATCH] Use any instead of False in generator any is both idiomatic and easier to read. There's no performance difference because both will stop as soon as a matching value is found. Change-Id: Ia527d96844015085cc289869a3c4d2722db1043c --- glanceclient/v2/shell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glanceclient/v2/shell.py b/glanceclient/v2/shell.py index 238fcd3e..95715e3b 100644 --- a/glanceclient/v2/shell.py +++ b/glanceclient/v2/shell.py @@ -111,7 +111,7 @@ def do_image_list(gc, args): filter_items = [(key, getattr(args, key)) for key in filter_keys] if args.properties: filter_properties = [prop.split('=', 1) for prop in args.properties] - if False in (len(pair) == 2 for pair in filter_properties): + if any(len(pair) != 2 for pair in filter_properties): utils.exit('Argument --property-filter expected properties in the' ' format KEY=VALUE') filter_items += filter_properties