Skip to content

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

@Horstage

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions