This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: remove() method is not working as expected(Hard to explain)
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.8
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: bjs, ctf.challenge.pushpam
Priority: normal Keywords:

Created on 2020-09-30 15:45 by ctf.challenge.pushpam, last changed 2022-04-11 14:59 by admin. This issue is now closed.

File name Uploaded Description Edit ctf.challenge.pushpam, 2020-09-30 15:45 python file
Messages (2)
msg377708 - (view) Author: pushpam kumar (ctf.challenge.pushpam) Date: 2020-09-30 15:45
I am not able to understand why "password" word is not removed by remove() method
msg377710 - (view) Author: Ben (bjs) * Date: 2020-09-30 15:54
See the note in "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 to clarify the docs about this,  but it is not a bug in Python.
Date User Action Args
2022-04-11 14:59:36adminsetgithub: 86059
2020-09-30 17:07:13eric.smithsetstatus: open -> closed
type: behavior
resolution: not a bug
stage: resolved
2020-09-30 15:54:04bjssetnosy: + bjs
messages: + msg377710
2020-09-30 15:45:40ctf.challenge.pushpamcreate