On Readability, Thought Process, and Coding Fluency

You might be interested in voicing your support for a pipeline syntax proposed in the ongoing discussion, where with my proposed syntax plus a later revision to position a piped object as the first argument by default, your throught process above can be better expressed as:

from operator import *

a + b |> sub(d) |> mul(f) |> div(h) as answer # or a |> add(b) |> sub(d) ...

or:

a + b |> _ - d |> _ * f |> _ / h as answer

Like I mentioned in the post, the proposed syntax is all about giving people the option to write code that better fits their mental model.

2 Likes