Ben <benjsim...@gmail.com> added the comment:

See the note in 
https://docs.python.org/3.7/reference/compound_stmts.html#the-for-statement 
"There is a subtlety when the sequence is being modified by the loop ..."

Since your code is mutating the  all_fields  list as you iterate it, you get 
the " next item will be skipped " behaviour, which is why the loop is skipping 
over "password".  remove() was never called to remove "password".

There is an open issue https://bugs.python.org/issue32767 to clarify the docs 
about this,  but it is not a bug in Python.

----------
nosy: +bjs

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41893>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to