News for hackers. Stuff that matters.
Re:Show HN: Array – A Better Python List by joshuamorton on Monday January 11, 2021 @03:31AM (#25726243)
You can do this without the walrus in a one liner as well, I believe:

    [area for area in (to_area(x, y) for x, y in zip(h, w)) if area > 10]

or generally, you can take a multiline statement like the one you have and replace named value with its expression. Add some indentation and it's not too bad:

    [area for area in 
     (to_area(x, y) for x, y in zip(h, w))
     if area > 10]

There are no comments on this comment yet.