Re: request help with Pipe class in iterwrap.py

2006-05-03 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], 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::

Re: request help with Pipe class in iterwrap.py

2006-05-03 Thread Steve R. Hastings
On Wed, 03 May 2006 08:01:12 +0200, Marc 'BlackJack' Rintsch wrote: 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)

request help with Pipe class in iterwrap.py

2006-05-01 Thread Steve R. Hastings
While studying iterators and generator expressions, I started wishing I had some tools for processing the values. I wanted to be able to chain together a set of functions, sort of like the pipelines you can make with command-line programs. So, I wrote a module called iterwrap.py. You can