Neil Schemenauer <nas-pyt...@arctrix.com> added the comment:

I was thinking about this more today and I think the better fix is to actually 
build the trashcan mechanism into _Py_Dealloc().  Requiring that types opt-in 
to the trashcan mechanism by using the trashcan macros is not ideal.  

First, the trashcan macros are a bit tricky to use correctly.  Second, every 
"container" type is potentially a part of a long ref chain and could blow up 
the stack on deallocation (i.e. triggered from DECREF).  So, for 
correctness/robustness, every type that supports cyclic GC should get 
trashcan-style deallocation.

We would have to find a way to do this without incurring a (significant) 
performance hit.  Also, it would have to be done without breaking C extensions. 
 Ideally they would get trashcan-style deallocation without any source code 
changes.  I'm not sure if that can be done but I'm hopeful it's possible.

----------

_______________________________________
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