[Python-bugs-list] [ python-Bugs-682906 ] refcount leak in list +=

SourceForge.net noreply@sourceforge.net
Sat, 08 Feb 2003 06:43:59 -0800


Bugs item #682906, was opened at 2003-02-08 15:43
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=682906&group_id=5470

Category: None
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Nobody/Anonymous (nobody)
Summary: refcount leak in list +=

Initial Comment:
The following script leaks references:

import sys

c = 100
L = []

def test():
·    L2 = L
·    L2 += [1]*c

for i in xrange(10):
·    test()
·    print sys.gettotalrefcount()

The number of references leaked is exactly the value of 
c.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=682906&group_id=5470