News for hackers. Stuff that matters.
Re:PEP 572: Python assignment expressions has been accepted by repsilat on Tuesday July 03, 2018 @04:40PM (#17453453)
> [bar(x) for z in stuff if (x := foo(z))]

Someone showed me this in a previous thread:

>> [bar(foo_z) for z in stuff for foo_z in [foo(z)] if foo_z]

Not a common idiom, though. Neither snippet is perfectly clear to me, but yours is closer.

Re:PEP 572: Python assignment expressions has been accepted by ehsankia on Wednesday July 04, 2018 @08:37AM (#17456895)
The iterating over map(foo, stuff) version is much cleaner and readable imo