[Python-Dev] Marking GC details as CPython-only

Antoine Pitrou solipsis at pitrou.net
Wed Feb 13 20:40:46 CET 2013


On Wed, 13 Feb 2013 20:30:18 +0100
Armin Rigo <arigo at tunes.org> wrote:
> Hi,
> 
> On Wed, Feb 13, 2013 at 8:22 PM, Maciej Fijalkowski <fijall at gmail.com> wrote:
> > I think it's well documented you should not rely on stuff like that
> > being run at the exit of the interpreter.
> 
> Actually right now, at the exit of the interpreter, we just leave the
> program without caring about running any __del__.  This might mean
> that in a short-running script no __del__ is ever run.  I'd add this
> question to your original list: is it good enough, or should we try
> harder to run destructors at the exit?

Destructors should be run at exit like they would be in any other
finalization situation. Anything else is dangerous, since important
resources may not be finalized, committed, or released.

(and by destructors I also mean weakref callbacks)

Regards

Antoine.




More information about the Python-Dev mailing list