[issue18372] _Pickler_New() doesn't call PyObject_GC_Track(self)

Serhiy Storchaka report at bugs.python.org
Mon Apr 8 10:19:53 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Tracking objects that do not need this will just add work to the garbage collector. Not all instances of trackable types should be tracked, for example the empty tuple and some dicts are not tracked.

>>> gc.is_tracked(())
False
>>> gc.is_tracked((1, 2))
True
>>> gc.is_tracked({1: None})
False
>>> gc.is_tracked({1: []})
True

----------

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


More information about the Python-bugs-list mailing list