Antoine Pitrou <pit...@free.fr> added the comment: > The particular case is this: I have objects (tasklets) that depending > on their runtime state, need to run a finalizer or not. If not, they > can be collected. If they do, then they end up on gc.garbage.
But why don't you try using tp_dealloc as I suggested instead? It will allow you to run a finalizer in all cases, without anything ending up in gc.garbage. It's what we do in the new io lib. Also, I'm still worried that the mechanism you're proposing is a bit quirky. I hope other developers can give opinions or even suggestions. > But since these patches of mine seem to be met with rather limited > enthusiasm, I wonder if I should be bothering. Well, the GC is a rather delicate affair and moreover it doesn't have a dedicated maintainer. That doesn't mean your patches are not interesting, but I think everyone tries to be very careful with that area of the code. ---------- nosy: +amaury.forgeotdarc, loewis _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9141> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com