Neal Norwitz wrote:
> On 2/15/06, Alain Poirier <[EMAIL PROTECTED]> wrote:
>>   - isn't the current implementation of itertools.tee (cache of previous
>>     generated values) incompatible with the new possibility to feed a
>>     generator (PEP 342) ?
> 
> I'm not sure what you are referring to.  What is the issue?

The 'tee' object doesn't have a "send" method. (This is true for all of the 
itertools iterators, I believe).

The request is misguided though - the itertools module is designed to operate 
on output-only iterators, not on generators that expect input via send(). 
Because the output values might depend on the values sent, then it makes no 
sense to cache them (or do most of the other things itertools does).

The relevant functionality would actually make the most sense as a fork() 
method on generators, but PEP 342 was trying to be fairly minimalist.

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to