[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)
Brandt Bucher
report at bugs.python.org
Thu Dec 3 10:30:57 EST 2020
Brandt Bucher <brandtbucher at gmail.com> added the comment:
> I add Pablo and Tim who love GC puzzles.
Well, I don’t think the GC is really doing anything wrong here... untracking these sort of tuples likely results in a noticeable reduction in collection times. This code is definitely testing the limits of what is “okay” for us to do with a tuple, and it’s breaking the GC’s (reasonable) assumptions.
I kept digging around, and it appears dict.items() is affected, too (which is a bit scarier). The same fix still works, though.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42536>
_______________________________________
More information about the Python-bugs-list
mailing list