Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-20 Thread Kristján Valur Jónsson
: Antoine Pitrou Cc: python-dev@python.org Subject: Re: [Python-Dev] issue 9141, finalizers and gc module 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

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-20 Thread Maciej Fijalkowski
opinion :) Cheers, fijal > > > ** ** > > K > > ** ** > > *From:* python-dev-bounces+kristjan=ccpgames@python.org [mailto: > python-dev-bounces+kristjan=ccpgames@python.org] *On Behalf Of *Maciej > Fijalkowski > *Sent:* 17. apríl 2012 21:29 > *To:* Antoine Pit

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-20 Thread Kristján Valur Jónsson
> -Original Message- > From: python-dev-bounces+kristjan=ccpgames@python.org > [mailto:python-dev-bounces+kristjan=ccpgames@python.org] On > Behalf Of mar...@v.loewis.de > Sent: 18. apríl 2012 07:11 > To: python-dev@python.org > Subject: Re: [Python-Dev] i

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-18 Thread martin
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? It's a hack, an

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-17 Thread Maciej Fijalkowski
On Tue, Apr 17, 2012 at 8:30 PM, Antoine Pitrou wrote: > On Tue, 17 Apr 2012 17:22:57 + > Kristján Valur Jónsson wrote: > > > > > > We are all consenting adults. Everything is allowed - you just have to > live with > > > the consequences. > > > > Well, we specifically decided that objects wi

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-17 Thread Antoine Pitrou
On Tue, 17 Apr 2012 17:22:57 + Kristján Valur Jónsson 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. > Th

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-17 Thread Kristján Valur Jónsson
> -Original Message- > > No, that's not the case at all. As Antoine explains in the issue, there are > plenty of ways in which Python code can be run when breaking a cycle. Not > only weakrefs, but also objects released as a consequence of tp_clear which > weren't *in* the cycle (but hun

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-17 Thread martin
What I want to know is, why is this limitation in place? Here are two possibilities: 1) "The order of calling finalizers in a cycle is undefined so it is not a solvable problem". But this would allow a single object, with only internal cycles to be collected. Currently this is not

[Python-Dev] issue 9141, finalizers and gc module

2012-04-17 Thread Kristján Valur Jónsson
Hello there. For those familiar with the intricacies of the gcmodule.c, I would like to draw your attention to http://bugs.python.org/issue9141. I would like to consult with you to find out more about finalizers/gc in order to improve the in-file documentation. Traditionally, it has not been po

[Python-Dev] issue 9141

2010-07-04 Thread Kristján Valur Jónsson
Dear colleagues: I'd like to have your input on http://bugs.python.org/issue9141 "Allow objects to decide if they can be collected by GC." This generalizes the dynamic discovery of finalization state of objects, as already provided for generator objects with PyGen_NeedsFinalizing(),to any objec