fix: .over was mutating expressions in some cases#3638
Conversation
| new_nodes = list(self._nodes) | ||
| new_nodes = deepcopy(list(self._nodes)) |
There was a problem hiding this comment.
based on the name, it looks like i was under the impression that list would copy the tuple self._nodes
There was a problem hiding this comment.
That is usually enough when trying to avoid the dictionary changed size during iteration issue - which is probably more common to run into
There was a problem hiding this comment.
not sure what you mean here sorry
There was a problem hiding this comment.
I meant that if self._nodes were a dict, then the code you wrote would have avoided an error related to mutation.
I was trying to say that it wasn't unreasonable to expect it would work for tuple too 🙂
|
Thanks for following up on this @MarcoGorelli Since I kinda fell into this one by chance, do you think there might be any other places since introducing
|
|
sure, added a test for when/then |

thanks @dangotbanned for spotting this on discord https://discord.com/channels/1235257048170762310/1272835922924273694/1492563536696578248
Description
What type of PR is this? (check all applicable)
Related issues
Checklist