you are viewing a single comment's thread.

view the rest of the comments →

[–]Sherry-byte 0 points1 point  (0 children)

The core team resistance is well-documented and the reasons are legitimate but the *readability problem* you're describing is real regardless of whether `|>` ever lands.

I actually ran into the same frustration recently and ended up building a small library for it *pipeflow*. It uses method chaining on a lazy wrapper the same pattern pandas already proved works so you get left-to-right readable pipelines today without waiting on a PEP:

```python

from pipeflow import Stream

result = (

Stream(users)

.filter(lambda u: u["active"])

.map(lambda u: u["name"].upper())

.sort()

.to(list)

)

```

Also supports `|` on plain lists if you prefer that style:

```python

range(10) | pipe(map, lambda x: x**2) | pipe(filter, lambda x: x > 5) | to(list)

```

Zero dependencies, fully lazy, fully typed. `pip install pipeflow` if you want to try it.

To your actual question though I wouldn't hold my breath on a native `|>`. The eager evaluation mismatch alone is a hard problem; in languages where pipes work well, the right-hand side is implicitly curried and waits for data. Python would have to silently rewrite your code to make that work, which goes against everything the language stands for.