Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
I decided to risk this "catastrophic" leak, and ran this: py> x = leaks() py> x ((2, 3), <weakref at 0xb7a1998c; to 'function' at 0xb789826c (f)>, 24) py> import gc py> gc.collect() 22 py> x ((2, 3), <weakref at 0xb7a1998c; dead>, 24) so I think Eric is correct, it is just a garbage collection issue. Possibly a bug, possibly normal behaviour. I don't think it is a documentation bug, if it is a bug at all it might be a garbage collection bug. But I really don't know, because I don't understand what Dan thinks is the memory leak here or why it happens. I *think* Dan might be referring to the fact that each time you call leaks(), there's one extra reference to itertools.repeat. Dan, if you can confirm that's the leak you are referring to, we would have a better chance of deciding whether it is a bug and if so if it is specific to exec. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33814> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com