[Python-Dev] __traceback__ and reference cycles

Armin Rigo arigo at tunes.org
Mon Aug 8 10:38:12 CEST 2005


Hi,

On Mon, Aug 08, 2005 at 10:31:06AM +0200, Armin Rigo wrote:
> see the attached program...

Oups.  Here it is...


Armin
-------------- next part --------------
import sys, time

def log(typ, val, tb):
    pass

class X:
    def __del__(self):
        try:
            typo
        except Exception, e:
            e_type, e_value, e_tb = sys.exc_info()
            log(e_type, e_value, e_tb)


t = time.time()
while True:
    lst = [X() for i in range(1000)]
    t1 = time.time()
    print t1 - t
    t = t1


More information about the Python-Dev mailing list