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

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

Open
DetachHead opened this issue Dec 16, 2024 · 1 comment
Labels
bug Something isn't working help wanted Contributions especially welcome

Comments

@DetachHead
Copy link

_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

@MichaReiser MichaReiser added bug Something isn't working help wanted Contributions especially welcome labels Dec 16, 2024
@MichaReiser
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Contributions especially welcome
Projects
None yet
Development

No branches or pull requests

2 participants