Skip to content

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

Description

@Horstage

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions