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

Report global object redefinition #9807

Open
sam-s opened this issue Jul 16, 2024 · 0 comments
Open

Report global object redefinition #9807

sam-s opened this issue Jul 16, 2024 · 0 comments
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling

Comments

@sam-s
Copy link

sam-s commented Jul 16, 2024

Current problem

The following code redefines global objects and should be reported as such:

foo = 10
def f(x):
    return x + foo
foo = 100
def f(x):
    return x - foo

Desired solution

It would be nice to get a warning like

line 4: global variable `foo` redefined (defined in line 1)
line 5: global function `f` redefined (defined in line 2)

Additional context

We already have redefined-outer-name but it only warns when a global name is redefined locally, not globally.

@sam-s sam-s added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling
Projects
None yet
Development

No branches or pull requests

1 participant