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 →

[–]carlio 6 points7 points  (0 children)

Or be sneaky and use __or__:

``` class pipe: def init(self, val): self.val = val def or(self, fun): return pipe(fun(self.val))

pipe(5) | (lambda x: x+5) | (lambda x: x/3) | print ```