Replace generator expression by list comprehension

Old Cython version doesn't support generator expression.