User talk:WillNess: Difference between revisions

m
no edit summary
(citing docs)
mNo edit summary
Line 16:
return tuple(gen(d) for d in deques)
</lang>
:I read it to show that each iterator produced by <code>tee()</code> holds on to its own dequeue (list with pop() and append()). When a new item is needed from the underlyingoriginal generatoriterable, it is appended separately into each one of the dequeues. Were they all to share one dequeue amongst themselves, that would be a shared storage. <code>popleft()</code> wouldn't be always called, but only when the ''leftmost'' of internal iterators pointing into internal list would get advanced. [[User:WillNess|WillNess]] 10:53, 9 September 2011 (UTC)
751

edits