Neal Norwitz wrote: > On 2/15/06, Alain Poirier <alain.poirier at net-ng.com> 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 | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4