Tim Peters added the comment:
Dan, your bug report is pretty much incoherent ;-) This standard Stack
Overflow advice applies here too:
https://stackoverflow.com/help/mcve
Guessing your complaint is that:
sys.getrefcount(itertools.repeat)
keeps increasing by 1 across calls to `leaks()`
Steven D'Aprano added the comment:
I decided to risk this "catastrophic" leak, and ran this:
py> x = leaks()
py> x
((2, 3), , 24)
py> import gc
py> gc.collect()
22
py> x
((2, 3), , 24)
so I think Eric is correct, it is just a garbage collection issue. Possibly a
bug, possibly normal behavio
Steven D'Aprano added the comment:
Perhaps a little less self-righteous anger and a little more detail on this
alleged bug would be appropriate.
Quote:
I still think it's ridiculous that every item added to that dict has an
"extra", non-obvious reference count that is impossible to vanquish
Eric V. Smith added the comment:
It would be helpful if you could show what output you see, and how it differs
from what you expect.
I think you're just seeing reference cycles or some other delayed garbage
collection. If you put in a gc.collect() in your loops to force a collection,
you'll
New submission from Dan Snider :
Sort of because I'm really not sure if it's working as intended or not. When I
found this out today, I noticed that the documentation of `exec` has been
updated since the last time I saw it, which is good, but it still leaves much
to be desired. Specifically,