Alexander Belopolsky added the comment:

With the following patch:

===================================================================
--- Lib/test/test_itertools.py  (revision 61284)
+++ Lib/test/test_itertools.py  (working copy)
@@ -707,6 +707,12 @@
         a = []
         self.makecycle(takewhile(bool, [1, 0, a, a]), a)
 
+    def test_issue2246(self):
+        n = 10
+        keyfunc = lambda x: x
+        for i, j in groupby(xrange(n), key=keyfunc):
+            keyfunc.__dict__.setdefault('x',[]).append(j)
+                    
 def R(seqn):
     'Regular generator'
     for i in seqn:

$ ./python Lib/test/regrtest.py -R :: test_itertools

reports n*3 + 13 reference leaks.  This should give a clue ...

----------
nosy: +belopolsky

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2246>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to