Recently I've ran into a classic bug in a code base, to illustrate a minimal example:
some_list = [1,2,3]
for i in some_list:
if i % 2 == 0:
some_list.remove(i)
print(i)
To nobodies surprise this prints only 1 and 2.
I was surprised that none of my linters caught this.
Anyway, would it be possible to add a rule that detects changes to the iterable that is being iterated?
I'm also more than happy to contribute 🙂