You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is dangerous to use tuples with mutable objects. And I think it may help many people to understand it.
We expects immutable behavior from a tuple.
But we know that for container-like sequences (for our case for a tuple), all elements are held by reference.
When we put a mutable container-like sequence into a tuple, and after that we change value of it, tuple will be changed.
It may look like unexpected behavior and may lead to errors.
The text was updated successfully, but these errors were encountered:
Rule request
Hello,
I would like to suggest a new rule. I could not find it in the existing rules, but if it exists so, sorry for duplication.
Thesis
I am proposing a new check for a tuple if a tuple contains a mutable object.
Reasoning
It is dangerous to use tuples with mutable objects. And I think it may help many people to understand it.
We expects immutable behavior from a tuple.
But we know that for container-like sequences (for our case for a tuple), all elements are held by reference.
When we put a mutable container-like sequence into a tuple, and after that we change value of it, tuple will be changed.
It may look like unexpected behavior and may lead to errors.
The text was updated successfully, but these errors were encountered: