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

Georg Brandl report at bugs.python.org
Sat May 16 17:18:18 CEST 2009


Georg Brandl <georg at python.org> added the comment:

I wouldn't call it *wrong* as much as *not the whole truth*.  It is true
that if just one key is added or removed, a RuntimeError will be raised.
 There are probably lots of places in our docs where the whole truth
isn't told, but in a way that works if you do the sensible thing.

In this case I can neither see anyone relying on RuntimeError being
raised (except for dict's own test suite), nor an implementor looking
only at these docs, not the source, to implement one of Python's most
crucial object types.

Anyway, if you find a new wording that isn't too clumsy, I'll change it.

----------

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


More information about the Python-bugs-list mailing list