I'm going to maybe out myself as having limited experience here ... I don't mind the idea here, seems good. But I also don't move a block of code often and discover variable assignment related issues. Is the bad outcome more often seen in C/C++ or specific use cases? Granted my coding style doesn't tend to involve a lot of variables being reassigned or used across vast swaths of code either so maybe I'm just doing th…
It is not about mutable/immutable objects , it is about using a name for a single purpose within given scope.
a = 1
b = 2
a = b
"a" name refers to the "2" object. "1" hasn't changed (ints are immutable in Python). If nothing else references it, it might as well disappear (or not).Though both "single purpose" and immutability may be [distinct] good ideas.