[New-bugs-announce] [issue26492] Exhausted array iterator should left exhausted
report at bugs.python.org
Sun Mar 6 11:04:40 EST 2016
New submission from Serhiy Storchaka:
There is general rule that after raising StopIteration the iterator should always raise StopIteration even if new data is added to iterating sequence. Array iterators don't obey this rule.
Proposed patch makes array iterator to left in exhausted state since it achieved. As a side (or may be primary) effect of this change, iterating sequence can be freed just after iterating is finished.
Added tests for other iterators of resizable sequences.
I don't know whether this patch should be applied to maintained releases or only to default branch. Note that array pickling tests broken by this patch were just added. They just expose current (presumably incorrect) behavior.
components: Extension Modules
nosy: benjamin.peterson, larry, rhettinger, serhiy.storchaka
stage: patch review
title: Exhausted array iterator should left exhausted
versions: Python 3.6
Added file: http://bugs.python.org/file42079/exhausted_array_iterator.patch
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce