
Sept. 5, 2009
2:15 p.m.
On 5 Sep 2009, at 15:47 , Gerald Britton wrote: Ah -- so not a real function then (yet)? Though something we could
borrow from Haskell, I suppose, even though:
compose(foo,bar) == lambda x: foo(bar(x))
no?
Yeah but you could leverage Python's *args to get a compositor of more than two functions e.g. def compose(*funcs): return reduce(lambda f1, f2: lambda *args, **kwargs: f1(f2(*args, **kwargs)), funcs)