False positive E0601: used-before-assignment
when assignment of variables is inside if __name__ == "__main__":
#8543
Labels
Invalid
Not a bug, already exists or already fixed
Bug description
Pylint version 3.0.0a6 seems to produce an
used-before-assignment
error when variables are assigned withinif __name__ == "__main__":
function and later used in different functions.This is coming from latest pylint v3.0.0a6 (since there is no such error in previous pylint versions)
Example code to reproduce this error:
Logging this issue here to get more context around this, as this is just a false-positive with v3.0.0a6 or something that pylint is aiming to trigger in its newer versions (As the above code format is supported in python).
Configuration
No response
Command used
Pylint output
Expected behavior
Pylint should not trigger
used-before-asssignment
error.Pylint version
The text was updated successfully, but these errors were encountered: