[Python-ideas] The pipe protocol, a convention for extensible method chaining

Julien Palard julien at palard.fr
Tue May 26 16:33:19 CEST 2015


o/

On 05/26/2015 01:38 AM, Stephan Hoyer wrote:
> In the PyData community, we  really like method chaining for data
 > analysis pipelines:

A few month ago, I created an almost similar thread here:

  https://mail.python.org/pipermail//python-ideas/2014-October/029839.html

About a package of mine https://pypi.python.org/pypi/pipe that I'm not 
that proud of.

As the answers of my thread states, using piplines is not the Pythonic 
way to do things, it looks like it makes the code more readable, but 
it's not true, there's [always] a Pythonic way to write the same code 
but readable. By affecting intermediate computation to variables for 
example, side gain: variables are named, so self-documenting.

My point of view about pipes is that it's hard to modify as, for the 
reader, what is passed between each action is opaque.

My point of view about my library is that i should not expose an 
operator overloading, as it may confuse people actually needing `|` to 
apply a `binary or` to a result of a chained thing.

--
Julien Palard



More information about the Python-ideas mailing list