Using a list comprehension like you had is valid, but it looks really weird, because you're creating a temporary object (a list) and not returning it. It looks like you mistakenly forgot to include a return statement, or left this here by mistake.

By hoisting this out into an explicit `for` loop, the intention of invoking a function that has side effects is more clear.