Hacker News new | ask | show | jobs
by orf 1992 days ago
> all(map(func3, filter(func2, map(func1, zip(a, b)))))

You definitely wouldn’t do this in “traditional Python”. You’d use a comprehension of some kind, or even the walrus operator, which is quite possibly faster and more readable than several chained lambdas.

1 comments

Fair enough, the example is a bit exaggerated. You could implement it with comprehensions

  all(func3(y) for y in (func1(x) for x in zip(a, b)) if func2(y))
It most likely is a bit faster, but I wouldn't say it's more readable.