April 10, 2014
10:20 p.m.
On 10 April 2014 23:09, Jacek Pliszka <jacek.pliszka@gmail.com> wrote:
OK, if method chaining is a problem, what about:
from StreamAlgebra import Map, Filter, Reduce from operator import add
range(100) | Filter(f1) | Map(f2) | Filter(f3) | Map(f4) | Reduce(add)
It's not so much that these types of things are "a problem" - more that they are simply not common usage in Python, and so are unfamiliar. You can certainly write code that uses method chaining, or your StreamAlgebra module. They are entirely legitimate as 3rd party code. What's less clear is that they belong in the core / stdlib, because core code typically should be idiomatic, and these styles are not idiomatic Python (for better or worse). Paul