> -----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] issue 9141, finalizers and gc module
> 
> Invoking methods in tp_clear I find fairly harmless, in comparison. My only
> concern is that errors are silently ignored. However, I don't think this 
> matters
> in practice, since io objects typically are not part of cycles, anyway.
> 
> > Why not allow it for all objects, then?
> 
> It's *allowed* for all objects. Why do you think it is not?
> 
Oh, because dynamic classes with __del__ methods are deliberately not collected 
but put in gc.garbage.  And the special case of the generator object, etc. etc.

iobase.c probably documents its own needs well enough.  The fact that I had to 
raise this question here, though, means that the source code  for gcmodule.c 
doesn't have enough information to explain exactly the problem that it has with 
calling finalizers.
It seems to me that it worries that __del__ methods may not run to completion 
because of attribute errors, and that it would have to silence such errors to 
not cause unexpected noise.
That is the impression I get from this discussion.  Correctness over memory 
conservation, or something like that.

Btw, regarding object resurrection, I was working on a patch to get that to 
work better, particularly with subclasses.
You may want to check out issue 8212, whence this discussion originates.

K


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to