[issue42536] Iterating on a zip keeps objects alive longer than expected (test_itertools leaks sometimes references)

Pablo Galindo Salgado report at bugs.python.org
Thu Dec 3 18:34:18 EST 2020


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I forgot to mention the conclusion: my conclusion is that although the GC is resilient to these shenanigans (it was also extensive validation along with the algorithm), I still prefer to track it on the next() call because is technically the right thing to do: A tuple has been mutated so it must be (potentially) tracked because it needs to behave "AS IF" the tuple was being created from scratch.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42536>
_______________________________________


More information about the Python-bugs-list mailing list