This fixes false positives when assigning to x.some_name but reading via some_name.
Note this produces false negatives in the opposite situation when x.some_name and some_name are different, so this is a trade-off in the direction of more precision / less sensitivity.
Description
This fixes false positives when assigning to
x.some_name
but reading viasome_name
. Note this produces false negatives in the opposite situation whenx.some_name
andsome_name
are different, so this is a trade-off in the direction of more precision / less sensitivity.This direction is in line with pyflakes design principles: https://github.com/PyCQA/pyflakes#design-principles
Fixing this more accurately probably requires a lot more work to trace references and analyze context.
Related Issue
221
Checklist: