Message319191
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()`, then as Eric said it will drop back to its original value after a `gc.collect()` call.
Steven, best I can tell weakrefs have nothing to do with this. The refcount on itertools.repeat increases if
weakref.ref(ns['f']),
is deleted.
It's a simple reference cycle. That is
ns['f'].__globals__ is ns
is True, so `ns` can't be collected via reference counting, and so `ns` also holds a reference to the irrelevantly renamed `itertools.repeat` too until cyclic gc can detect the trash cycle.
Dan, if that's _not_ what you're complaining about, please follow the advice at the top and add a focused, minimal example of what you are talking about. In the meantime, I'm closing this as not-a-bug. |
|
Date |
User |
Action |
Args |
2018-06-10 00:46:08 | tim.peters | set | recipients:
+ tim.peters, eric.smith, steven.daprano, docs@python, bup |
2018-06-10 00:46:08 | tim.peters | set | messageid: <1528591568.82.0.592728768989.issue33814@psf.upfronthosting.co.za> |
2018-06-10 00:46:08 | tim.peters | link | issue33814 messages |
2018-06-10 00:46:07 | tim.peters | create | |
|