[issue41984] Empty __slots__ can create untracked reference cycles

Pablo Galindo Salgado report at bugs.python.org
Fri Oct 9 15:46:26 EDT 2020


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

Thanks for noticing this, Brandt!

> The fix is simple: track all instances of user-defined classes, no exceptions

I have the fear that this may increase the time of collections substantially because even if many of them won't have references at all, they still net to be visited and they count towards the time complexity of the algorithm that detects isolated sub-cycles. I mention this because this could affect an unbounded number of instances per type. For example, some of the types that are untracked.

Maybe I am missing something but we could mark them as having GC support unconditionally but still leave them untracking and unconditionally add a tracking call on setattribute.

----------
nosy: +nascheme, tim.peters

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


More information about the Python-bugs-list mailing list