[Python-ideas] Adding a pipe function to functools

Julien Palard julien at palard.fr
Fri Apr 15 14:24:22 EDT 2016


Le 15 avril 2016 19:29:40 GMT+02:00, "João Bernardo" <jbvsmo at gmail.com> a écrit :
>I really like this tool:

First, thank you João !

However I almost don't use it myself, I dislike the idea of exposing an overloaded operator (may cause surprises), and there's in fact a very few places where it's really clearer without reducing maintainability. I mean, working with a long pipe is opaque (no variables involved, so no logging no breakpoints, and no names, well chosen names helps readability).

Also using my Pipe module forces you to mix infix with prefix calls, and I dislike mixing syntaxes, yet having some DSL is sometime cool when they are really useful, think of SQL typically.

Finally the resulting code does clearly not look like Python code, even if readable, it may hurt readability, causing a surprise like "wow what is that, how is it possible ?" Almost forcing one to read Pipe doc instead of simply read Python code ...

All of this obviously also apply to the idea of adding an infix call syntax to the stdlib, so I'm -1 on it.

Julien Palard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160415/a890c39d/attachment-0001.html>

More information about the Python-ideas mailing list