2 ms·
> 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 eve
by orf 6y 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.
- deleted 6y ago[deleted]
- lauriat 6y agoFair 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.