[issue6017] Dict fails to notice addition and deletion of keys during iteration

Steven D'Aprano report at bugs.python.org
Sat May 16 16:02:42 CEST 2009


Steven D'Aprano <steve at pearwood.info> added the comment:

With respect Georg, given that the behaviour won't be changed, the 
documentation is simply *wrong*. It's not a matter of telling 
people "don't do this" -- somebody, somewhere, is going to rely on the 
documented behaviour. The docs make the clear promise that, and I 
quote, "Using iteritems() while adding or deleting entries in the 
dictionary will raise a RuntimeError", but that's not what happens. 
The actual behaviour is undefined.

----------

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


More information about the Python-bugs-list mailing list