[Python-ideas] Adding a pipe function to functools
wes.turner at gmail.com
Sat Apr 16 02:04:25 EDT 2016
On Apr 16, 2016 12:07 AM, "Steven D'Aprano" <steve at pearwood.info> wrote:
> On Fri, Apr 15, 2016 at 01:51:45PM -0500, Wes Turner wrote:
> > *
> > from functional import compose, partial
> > import functools
> > multi_compose = partial(functools.reduce, compose)
> > * https://docs.python.org/3.5/library/functools.html
> > * functools.compose is gone!
> functools.compose never existed. The above example is
> functional.compose, a third party library.
my mistake. in my haste, I had thought that functional was functools.
it looks like funcy has both curry() and compose():
* http://funcy.readthedocs.org/en/stable/funcs.html#curry #compose
* https://github.com/Suor/funcy/blob/master/funcy/funcs.py #compose
* https://github.com/Suor/funcy/blob/master/funcy/simple_funcs.py #curry
and fn.py has __lshift__ and __rshift__ for F.__compose:
> Python-ideas mailing list
> Python-ideas at python.org
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas