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/2003-April/034522.html below:

[Python-Dev] Garbage collecting closures

[Python-Dev] Garbage collecting closures [Python-Dev] Garbage collecting closuresGuido van Rossum guido@python.org
Fri, 11 Apr 2003 20:45:40 -0400
> Does this bug look familiar to anyone?
> 
> import gc
> 
> def bar(a):
>      def foo():
>          return None
>          x = a
>          foo()
> 
> class C:pass
> a = C()
> 
> for i in range(20):
>      print len(gc.get_referrers(a))
>      x = bar(a)
> 
> On my Python, it just counts up. "a" gets more and more referrers and 
> they are "cell" objects. If it is unknown, I'll submit a bug report 
> unless someone fixes it before I get to it. ;)

If I use a "while 1" loop, the count never goes above 225.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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