pyflakes
pyflakes copied to clipboard
False positive: F401 'foo' imported but unused; when marking variable as global variable in a function
False positive: F401 'foo' imported but unused
a.py:
from b import foo
def test():
global foo
print(foo)
foo = 'bar'
print(foo)
test()
b.py:
foo = 'foo'
Also resolves this PyCharm Error
I think it may be fixed after this is merged. because it actually regard the name as global, that is, if you rebind that name, the global one should be rebound too.
Issue confirmed under
$ pip freeze | grep flake
flake8==3.9.2
pyflakes==2.3.1