Fixed #23968 -- Replace list comprehension with generator comprehension when possible

As above I find `x = [...` followed by `x += (...` distracting.