Skip to content

Instantly share code, notes, and snippets.

@bpicolo
Last active November 14, 2017 20:58
Show Gist options
  • Save bpicolo/702bde86b71e9aa141529755e9398d68 to your computer and use it in GitHub Desktop.
Save bpicolo/702bde86b71e9aa141529755e9398d68 to your computer and use it in GitHub Desktop.
pypes
def pipe(arg, *fns):
out = arg
for fn in fns:
out = fn(out)
return out
result = pipe(
1,
lambda x: x + 2,
lambda x: x * 2
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment