Comprehension To Generator

Python pattern

Replace unneeded list comprehensions with direct generators.

Comprehension to generator

BEFORE
hat_found = any([is_hat(item) for item in wardrobe])
hat_found = list([is_hat(item) for item in wardrobe])

hat_found = dict([(item, is_hat(item)) for item in wardrobe])
AFTER
hat_found = any(is_hat(item) for item in wardrobe)
hat_found = list(is_hat(item) for item in wardrobe)

hat_found = dict([(item, is_hat(item)) for item in wardrobe])