[docs] [issue16225] list.remove in for loop

Serhiy Storchaka report at bugs.python.org
Mon Oct 15 01:00:23 CEST 2012


Serhiy Storchaka added the comment:

> I agree.  I removed the word "safe" in the patch I attached to reduce
> ambiguity.

Yes, so much the better.

It will be nice somewhere in deep clarify for experts what happens with list 
iterator if the list changed.

And iterating over modifyed (if you insert/remove keys, but not when you only 
update values) dict or set really yield unexpected results (i.e. they expected 
in them undefinability). This is really not recommended.

----------

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


More information about the docs mailing list