Re: Sets vs lists loop behaviour if size changes
Thanks for the response and the reference, indeed sets and lists behave differently... -- https://mail.python.org/mailman/listinfo/python-list
Sets vs lists loop behaviour if size changes
If set size changes during a for loop, a runtime exception is raised: ~~ S = {2015} for z in S: S.add(42) ~~ ~~ Traceback (most recent call last): File "_.py", line 2, in for z in S: RuntimeError: Set