Optimizing complex generator expressions [Updated]
See this: https://twitter.com/jakevdp/status/786920174595158018
The core expression is similar to this
y = (f(x) for x in L if f(x) is not None)
There are a lot of variations on the filter. The point is that the function appears twice in the above expression.
We …
more ...