Bash-like pipes in Python

Marko Rauhamaa marko at pacujo.net
Wed Mar 16 13:04:04 EDT 2016


Steven D'Aprano <steve at pearwood.info>:

> Here is a way to do functional-programming-like pipelines to collect
> and transform values from an iterable:
>
> https://code.activestate.com/recipes/580625-collection-pipeline-in-python/

Nice. The other day we talked about Python replacing bash. Pipelining is
a big step in that direction.

Note also the Scheme Shell (scsh):
URL: https://scsh.net/docu/html/man-Z-H-3.html>.

Question: Could the generators define __repr__ so you wouldn't need to
terminate the pipeline with "List" in interactive use?


Marko



More information about the Python-list mailing list