A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-December/031441.html below:

[Python-Dev] GC at exit?

[Python-Dev] GC at exit? [Python-Dev] GC at exit?Michael Hudson mwh@python.net
30 Dec 2002 10:58:01 +0000
Aahz <aahz@pythoncraft.com> writes:

> [Originally posted to comp.lang.python with no response; asking here
> before filing a bug report]
> 
> Is garbage collection supposed to run when Python exits?  The following
> program does not print any output, unless I uncomment the gc.collect()
> (or add a for loop that forces GC after creating the cycle):
> 
> import gc
> 
> class A:
>     pass
> 
> class B:
>     def __del__(self):
>         print "Bye-bye!"
> 
> a = A()
> b = A()
> a.b = b
> b.a = a
> a.x = B()
> 
> del a
> del b
> 
> #gc.collect()

One possibility is that the __del__ method *is* being run, but after
sys.stdout & so on has been torn down.  python -v can help, maybe?

Cheers,
M.

-- 
  Unfortunately, nigh the whole world is now duped into thinking that 
  silly fill-in forms on web pages is the way to do user interfaces.  
                                        -- Erik Naggum, comp.lang.lisp



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4