Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
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 == '')] ---------- nosy: +steven.daprano _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44952> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com