request help with Pipe class in iterwrap.py

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Wed May 3 02:01:12 EDT 2006


In <pan.2006.05.02.00.56.56.146384 at hastings.org>, Steve R. Hastings wrote:

> What is the friendliest and most Pythonic way to write a Pipe class for
> iterwrap?

Maybe one with less "magic" syntax.  What about using a function that
takes the iterators and an iterable and returns an iterator of the chained
iterators::

  new_list = pipe(grep('larch'), grep('parrot', 'v')), list)(my_list)


Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list