gh-116946: fully implement GC protocol for _thread._localdummy#138329
gh-116946: fully implement GC protocol for _thread._localdummy#138329picnixz wants to merge 1 commit intopython:mainfrom
_thread._localdummy#138329Conversation
Yes, only strong references needs to be traversed. Also, why does |
Even if it's "empty", the fact it's a heap type implies that it becomes a kind of "container" object as it has a reference to its type. At least, that's how the issue described the bug (and as the docs say). See also #87138 (comment). |
I agree, but the refcycle is only possible when the type is mutable then the cycle can be |
|
Hum. So there are a number of PRs I opened that are actually not necessary. Because if I'm following you on this one, then some commits were also not necessary in the past (some of them added GC support for empty immutable types). |
Yes, some of them in the past where done in cases where it wasn't needed but we should not do more of it, doing it increases pressure on GC which will slow down performance. |
|
Ok, I will revert the PRs that touch immutable empty types. Sorry for the noise. |
Did I correctly understand the fact that
weakreflistshould NOT be visited in the traverse function because the instance is not owning strong references to its elements here?cc @kumaraditya303