New submission from Neil Schemenauer <nas-pyt...@arctrix.com>:

The fix for bpo-33930 includes a somewhat mysterious comment:

    // The Py_TRASHCAN mechanism requires that we be able to
    // call PyObject_GC_UnTrack twice on an object.

I wonder if we can just integrate the untrack into the body of the trashcan 
code.  Then, the explicit call to untrack in the dealloc function body can be 
removed.  That removes the risk of incorrectly using the macro version.

I suspect the reason this was not done originally is because the original 
trashcan mechanism did not use the GC header pointers to store objects.  Now, 
any object that uses the trashcan *must* be a GC object.

----------
messages: 399356
nosy: nascheme
priority: normal
severity: normal
stage: needs patch
status: open
title: Consider integration of GC_UNTRACK with TRASHCAN
type: enhancement

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

Reply via email to