Serhiy Storchaka added the comment:

>From Doc/c-api/gcsupport.rst:

> Constructors for container types must conform to two rules:
> 
> #. The memory for the object must be allocated using :c:func:`PyObject_GC_New`
>    or :c:func:`PyObject_GC_NewVar`.
> 
> #. Once all the fields which may contain references to other containers are
> 
>    initialized, it must call :c:func:`PyObject_GC_Track`.

_pickle.Pickler and _pickle.Unpickler have the Py_TPFLAGS_HAVE_GC flag, 
implement tp_traverse and tp_clear, but PyObject_GC_Track is newer called.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18372>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to