3 ms·
That is a very bad idea in general and will lead to enormous memory leaks when large tee'd iterators get out of sync with one another. See here: This itertool
by Tulip68 10y ago
That is a very bad idea in general and will lead to enormous memory leaks when large tee'd iterators get out of sync with one another.
See here:
This itertool may require significant auxiliary storage (depending on how much temporary data needs to be stored). In general, if one iterator uses most or all of the data before another iterator starts, it is faster to use list() instead of tee().
https://docs.python.org/2/library/itertools.html#itertools.tee https://docs.python.org/2/library/itertools.html#itertools.t...
- xapata 10y agoEh? I discouraged tee'ing iterators, or at least I thought I did.