Oct. 10, 2021
12:17 a.m.
On 9/10/21 11:24 am, Tyler Hou via Python-ideas wrote:
Right now, the following code is valid in Python 3.9 (and infinitely loops):
``` lst = [1, 2, 3] for i in lst: lst.append(i) ```
1. If the size of a list, set, or dict changes, invalidate all existing iterators to that containers.
This would break Plex. I use a loop like that as part of the NFA-to-DFA conversion to calculate the epsilon-closure of a state (although obviously there are conditions on adding things to the list that ensure it terminates). -- Greg