-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WPS434 on tuple conversion #1807
Comments
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 |
I would leave this as
|
The same problem happens if you do |
Bug report
What's wrong
A
WPS434: Found reassigning variable to itself
violation is raised for the following code:How it should be
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.
The text was updated successfully, but these errors were encountered: