Warning for assignment of mutables #10408
boolean-light
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've run into lots of bugs related to assignments of mutables (e.g. lists, dicts, sets), like this:
But as far as I know, there are no rules which gives warning about this.
Could we add warning or possibly fixes (e.g. suggesting
copy
ordeepcopy
)?Probably because it requires type inference, it will be difficult to make it work for something like this:
But I think we could do this, like for first example, where the type of variable is straightforward.
Beta Was this translation helpful? Give feedback.
All reactions