Created
November 28, 2018 05:33
-
-
Save kzinmr/49ac657687e25d0a1c6504afddf754d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce | |
def compose(*functions): | |
return reduce(lambda f, g: lambda x: f(g(x)), functions, lambda x: x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also see for multivariable-map
https://docs.python.org/3/library/itertools.html#itertools.starmap
besides
https://docs.python.org/3/library/functools.html#functools.partial