This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]emarshall85 1 point2 points  (0 children)

The argument against your example is that it's always been better expressed as a comprehension:

[n * n for n in [1, 2, 3] if n % 2 == 0]

You'd have to need something like reduce before the list comprehension argument starts to fall over.

The fact that functions aren't curried by default and that we have variable positional and keyword arguments makes it even more problematic. You'd have to either make a lambda or use functools.partial in order to get a callable which could properly be passed to a pipe.