[issue7105] weak dict iterators are fragile because of unpredictable GC runs

Kristján Valur Jónsson report at bugs.python.org
Tue Nov 19 11:47:25 CET 2013


Kristján Valur Jónsson added the comment:

The changes for the docs are just a port of the original patch.  And indeed, these functions don't return an iterator, but a generator object.

I admit I'm confused by the difference, since next() can be called directly on the generator.  Still, a lot of code in the test explicitly calls iter() on the iterators before doing next().  Not sure why.

The commented out line is an artifact, I'll remove it, the correct one is the test for 20 items.

Otherwise, I have no vested interest in getting this in.  My porting this is just me contributing to 2.7.  If it's vetoed, we'll just put it in 2.8.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7105>
_______________________________________


More information about the Python-bugs-list mailing list