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:36:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629347766.57.0.1248507433.issue44952@roundup.psfhosted.org>
In-reply-to
Content
Not a bug. Use this instead:

def rv(items):
    for item in items[:]:  # iterate over a copy
        if not (item.isspace() or item == ''):
            items.remove(item)
    return items


Or the same as above, as a list comprehension, no need to make a copy:

items = [item for item in items if not (item.isspace() or item == '')]
History
Date User Action Args
2021-08-19 04:36:06steven.dapranosetrecipients: + steven.daprano, py_ok
2021-08-19 04:36:06steven.dapranosetmessageid: <1629347766.57.0.1248507433.issue44952@roundup.psfhosted.org>
2021-08-19 04:36:06steven.dapranolinkissue44952 messages
2021-08-19 04:36:06steven.dapranocreate