A WPS434: Found reassigning variable to itself violation is raised for the following code:
my_var = (my_var,)
As the code replaces the original object with a tuple containing it, the line is not a simple reasignation. Thus, the violation WPS434 should not be raised.
FYI, MyPy won't be happy with this code as well unless you have allow_redefinition enabled. So, probably it's worth making a new variable here.
It seems that redefinitions that narrow the original type are ok in Mypy. In my case this code is being used for a variable that can be either a tuple or an individual element, converting it into a one element tuple in that case. Mypy does not complain even with strict flags enabled, and reveal_type reflects the type narrowing correctly.
I would leave this as wontfix, because this is a very special case.
I would recommend to:
noqa for this lineThe same problem happens if you do my_var = (my_var, my_var). I know you said you will not fix it, but just in case.