[issue41893] remove() method is not working as expected(Hard to explain)

2020-09-30 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41893] remove() method is not working as expected(Hard to explain)

2020-09-30 Thread Ben


Ben  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41893] remove() method is not working as expected(Hard to explain)

2020-09-30 Thread pushpam kumar


New submission from pushpam kumar :

I am not able to understand why "password" word is not removed by remove() 
method

--
components: Interpreter Core
files: testtt.py
messages: 377708
nosy: ctf.challenge.pushpam
priority: normal
severity: normal
status: open
title: remove() method is not working as expected(Hard to explain)
versions: Python 3.8
Added file: https://bugs.python.org/file49478/testtt.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com