Karl asked me to post here:
Is there a canonical that would cover this question? [Why variable assignment behaves differently in Python?](https://stackoverflow.com/questions/77153141/why-variable-assignment-behaves-differently-in-python)
There is an FAQ entry: [Why did changing list ‘y’ also change list ‘x’?](https://docs.python.org/3/faq/programming.html#why-did-changing-list-y-also-change-list-x) and I tried searching for its title on SO but didn't find an exact match.
I commented two more close ones: [ [Why can a function modify some arguments as perceived by the caller, but not others?]…