Hi!

Sorry if someone has already talked about it (my simple search did not show any results).

What do you think about adding map, flatmap, filter and reduce methods to generator type ?

I must admit I've seen and I like Java 8 notation and I think it might be more readable than Python way in a few occasions.

I would like to be able to write:

range(100).\
  filter( f1 ).\
  map( f2 ).\
  filter( f3 ).\
  map( f4 ).\
  reduce(operator.add)

in addition to current Pythonic way of

reduce( operator.add, f4(x) for x in
  ( f2(y) for y in range(100) if f1(y))
 if f3(x) )

Though longer - Java way seems to be a bit  more readable as the notation follows the data flow sequence.

Do you think it is worth a PEP?

BR,

Jacek