Make this a generator comprehension. You're doing a generator comprehension below, so no sense in frocking around with the whole list if we can help it.