Bash-like pipes in Python
Sivan Greenberg
sivan at vitakka.co
Thu Mar 17 08:10:12 EDT 2016
If I understand correctly, the binary right or overloading that's seen here
can be applied to any other computational objects.
I could also think of implementing it for input / output pipes overloading
the __ror__ method with .communicate() method of the Popen object [0].
-Sivan
[0]: https://docs.python.org/2/library/subprocess.html#popen-objects
On Thu, Mar 17, 2016 at 1:49 PM, Marko Rauhamaa <marko at pacujo.net> wrote:
> Steven D'Aprano <steve at pearwood.info>:
>
> > On Thu, 17 Mar 2016 02:20 am, Random832 wrote:
> >> fpipe("abcd12345xyz", pfilter(str.isdigit), pmap(int), preduce(mul))
> >
> > Intriguing! Thank you for the suggestion.
>
> Still want the pipeline syntax!
>
>
> Marko
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
Sivan Greenberg
Co founder & CTO
Vitakka Consulting
More information about the Python-list
mailing list