# Introduce funnel operator i,e '|\>' to allow for generator pipelines

**URL:** <https://discuss.python.org/t/introduce-funnel-operator-i-e-to-allow-for-generator-pipelines/67701>\
**Category:** Ideas\
**Created:** [October 12, 2024, 11:04pm UTC](https://discuss.python.org/t/introduce-funnel-operator-i-e-to-allow-for-generator-pipelines/67701 "2024-10-12T23:04:08Z")\
**Posts on this page:** 1\
**Showing post:** 19

<div class="post-metadata">

**Author:** ![petercordia](https://avatars.discourse-cdn.com/v4/letter/p/bb73d2/32.png) [@petercordia](https://discuss.python.org/u/petercordia)\
**Post date:** [October 22, 2024, 3:38pm UTC](https://discuss.python.org/t/introduce-funnel-operator-i-e-to-allow-for-generator-pipelines/67701/19 "2024-10-22T15:38:31Z")

</div>

I agree with the desire of the original post, though for general objects and not just generators.  
Having opening and closing brackets far apart is ugly, hurts readability, and is annoying to write. And being forced to use intermediate variables leads to mistakes.

As an additional advantage, having such notation available would reduce the need for subclassing. (and wrappers.)

Though I would note that

```python
for index, bracket in brackets |> windowed(2) |> enumerate() |> tqdm():
  ...

```

looked confusing to me at first.

I think it’s preferable to demand the brackets, so that `f |> g` can be interpreted as `partial(g, f)`. The code you end up with that way looks more similar to other python code, specifically it will look very similar to method chaining, which python users are probably familiar with.  
Then again it wouldn’t completely clear to me whether `f |> g |> h` should mean `partial(h, partial(g, f))` or `partial(partial(h, g), f)` within that paradigm. Or whether that would even matter.

---

_[View the full topic](https://discuss.python.org/t/introduce-funnel-operator-i-e-to-allow-for-generator-pipelines/67701)._
