Skip to content
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

False positive: F401 'foo' imported but unused; when marking variable as global variable in a function #389

Open
Horstage opened this issue Nov 13, 2018 · 1 comment

Comments

@Horstage
Copy link

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

@seeeturtle
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants