This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pwuertz
Recipients pwuertz
Date 2020-03-23.14:34:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584974073.92.0.811600975239.issue40047@roundup.psfhosted.org>
In-reply-to
Content
Itertools `tee` does not seem to de-reference yielded items, even after consumption of all items from all tee-iterators.

According to the documentation (to my understanding), there shouldn't be any extra memory requirement as long as the tee-iterators are consumed in a balanced way. I.e. after an item was pulled from all iterators there shouldn't be any residual reference to it.

This is true for the example-implementation mentioned in the documentation, but `itertools.tee` doesn't de-reference items until the tee-iterator itself is deleted:

https://pastebin.com/r3JUkH41

Is this a bug or am I missing something?
History
Date User Action Args
2020-03-23 14:34:33pwuertzsetrecipients: + pwuertz
2020-03-23 14:34:33pwuertzsetmessageid: <1584974073.92.0.811600975239.issue40047@roundup.psfhosted.org>
2020-03-23 14:34:33pwuertzlinkissue40047 messages
2020-03-23 14:34:33pwuertzcreate