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.

Author steven.daprano
Recipients py_ok, steven.daprano
Date 2021-08-19.04:53:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
To understand why your code doesn't work, run this:

items = ['a', '', 'b', '', 'c', '', 'd', '', 'e', '']


for index, item in enumerate(items):
    print(index, repr(item), items)
    if item == '':

When you remove an item, all the remaining items slide over one position, into the slot that has already been inspected. That means that they get skipped.
Date User Action Args
2021-08-19 04:53:29steven.dapranosetrecipients: + steven.daprano, py_ok
2021-08-19 04:53:29steven.dapranosetmessageid: <>
2021-08-19 04:53:29steven.dapranolinkissue44952 messages
2021-08-19 04:53:29steven.dapranocreate