Skip to content

used-dummy-variable (RUF052) - false positive on private global variable when it has a usage in two functions #14996

Open
@DetachHead

Description

_bar: int


def foo():
    global _bar # error: Local dummy variable `_bar` is accessed
    _bar = 1


def baz():
    print(_bar)

https://play.ruff.rs/7b9e5645-c159-4e00-8b84-49183a6c31c4

Activity

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

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions