[Python-ideas] A way to tell the gc it's OK to delete an object with a __del__

Nick Coghlan ncoghlan at gmail.com
Fri Nov 14 08:45:55 CET 2014


On 14 November 2014 09:20, Chris Barker <chris.barker at noaa.gov> wrote:

> On Thu, Nov 13, 2014 at 10:50 AM, MRAB <python at mrabarnett.plus.com> wrote:
>
>> There's some code in this that you might find useful:
>>
>> http://permalink.gmane.org/gmane.comp.python.ideas/20334
>
>
> thanks -- that does look kind of like what I was thinking I'd need to do
> -- but in the long run what the gc to do it for me (which maybe it does in
> py3.4)
>
> But maybe I'll patch the netCDF lib with something like that -- folks will
> be using py < 3.4 for a long time yet :-(
>

PyPy's GC design is (very) different, and allows finalisation of reference
cycles involving __del__ even in Python 2. That path naturally comes with
its own C extension compatibility challenges, though.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141114/44358365/attachment-0001.html>


More information about the Python-ideas mailing list