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
This commit is contained in:
Ian Cordasco 2014-11-26 12:20:40 -06:00
parent 3b6754a8cc
commit a1bb3eb0a5
1 changed files with 1 additions and 1 deletions

View File

@ -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