Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev
Re: issue 9141, finalizers and gc module
 

Index | Next | Previous | View Flat


fijall at gmail

Apr 17, 2012, 2:29 PM


Views: 386
Permalink
Re: issue 9141, finalizers and gc module [In reply to]

On Tue, Apr 17, 2012 at 8:30 PM, Antoine Pitrou <solipsis [at] pitrou> wrote:

> On Tue, 17 Apr 2012 17:22:57 +0000
> Kristján Valur Jónsson <kristjan [at] ccpgames> wrote:
> > >
> > > We are all consenting adults. Everything is allowed - you just have to
> live with
> > > the consequences.
> >
> > Well, we specifically decided that objects with __del__ methods that are
> part of a cycle cannot be run.
> > The same reasoning was applied to generators, if they are in a certain
> state.
> > What makes iobase so special that its 'close' method can be run even if
> it is part of a cycle?
>
> The reason is that making file objects uncollectable when they are part
> of a reference cycle would be a PITA and a serious regression for many
> applications, I think.
>
> > Why not allow it for all objects, then?
>
> I'm not the author of the original GC design. Perhaps it was
> deliberately conservative at the time? I think PyPy has a more tolerant
> solution for finalizers in reference cycles, perhaps they can explain it
> here.
>
> Regards
>
> Antoine.


PyPy breaks cycles randomly. I think a pretty comprehensive description of
what happens is here:

http://morepypy.blogspot.com/2008/02/python-finalizers-semantics-part-1.html
http://morepypy.blogspot.com/2008/02/python-finalizers-semantics-part-2.html

Cheers,
fijal

Subject User Time
issue 9141, finalizers and gc module kristjan at ccpgames Apr 17, 2012, 3:55 AM
    Re: issue 9141, finalizers and gc module martin at v Apr 17, 2012, 7:45 AM
    Re: issue 9141, finalizers and gc module kristjan at ccpgames Apr 17, 2012, 10:22 AM
    Re: issue 9141, finalizers and gc module solipsis at pitrou Apr 17, 2012, 11:30 AM
        Re: issue 9141, finalizers and gc module fijall at gmail Apr 17, 2012, 2:29 PM
    Re: issue 9141, finalizers and gc module martin at v Apr 18, 2012, 12:11 AM
    Re: issue 9141, finalizers and gc module kristjan at ccpgames Apr 20, 2012, 6:28 AM
    Re: issue 9141, finalizers and gc module kristjan at ccpgames Apr 20, 2012, 6:33 AM
    Re: issue 9141, finalizers and gc module fijall at gmail Apr 20, 2012, 6:35 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.