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 -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/MRSG4GVX5C6BFJFUURPA2FXARWBHTDE7/ Code of Conduct: http://python.org/psf/codeofconduct/
