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

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/MRSG4GVX5C6BFJFUURPA2FXARWBHTDE7/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to