pyflakes icon indicating copy to clipboard operation
pyflakes copied to clipboard

Catch usage of undefined name with global statement

Open seeeturtle opened this issue 7 years ago • 19 comments

Related to #249

seeeturtle avatar Jan 17 '18 16:01 seeeturtle

@sigmavirus24 it seems the CI is failing not because of the test. Can you look at it?

seeeturtle avatar Jan 17 '18 18:01 seeeturtle

ah. sorry, I didn't know that it's error of flake8 please ignore the above comment

seeeturtle avatar Jan 17 '18 18:01 seeeturtle

wait... all flake8 error isn't related with my PR. it should be fixed.

seeeturtle avatar Jan 17 '18 18:01 seeeturtle

Also please add the test from the original issue to make sure the problem is corrected.

@adhikasp, I've already added. check the commit message.

seeeturtle avatar Jan 18 '18 13:01 seeeturtle

I've already added. check the commit message.

You mean this one? https://github.com/PyCQA/pyflakes/pull/324/commits/fdf2353d4b53c4c1305ed80e31ea6252845c6f26#diff-44d7abf892e78127bd9438c51e1cfd49R340

But this is different compared to the snippet in the original issue. There should be another test when a function have args with same name as a global variable declared inside it. The function in your test above doesn't receive any argument.

adhikasp avatar Jan 18 '18 13:01 adhikasp

Sorry. I thought it was same code.

seeeturtle avatar Jan 18 '18 13:01 seeeturtle

@adhikasp By the way, What error should this test catch? UndefinedName?

seeeturtle avatar Jan 18 '18 13:01 seeeturtle

The issue is actually different with the given task at gci...

seeeturtle avatar Jan 18 '18 13:01 seeeturtle

Yeah, the GCI task I specified is different to #249. The one I specified matches the test case @seeeturtle created.

def main():
    global x
    print(x)

main()

So I think @adhikasp's comment about the test doesn't apply.

(Actually, #249 would have been easier. I probably should have specified that case for the GCI task.)

myint avatar Jan 18 '18 14:01 myint

@myint Can you approve the task too?

seeeturtle avatar Jan 18 '18 14:01 seeeturtle

Hooray! I didn't thought I can do this task well, but I did :)

seeeturtle avatar Jan 18 '18 14:01 seeeturtle

Oh I see, my bad then 😄

adhikasp avatar Jan 18 '18 14:01 adhikasp

Just waiting for February now :) See you then

seeeturtle avatar Jan 18 '18 14:01 seeeturtle

Hello, @myint, I just found that this PR hasn't merged for a while. Is there any problem?

seeeturtle avatar Jul 15 '18 15:07 seeeturtle

@seeeturtle One of the other PyCQA members needs to approve this before I can merge it. This is the case for several of the open pull requests.

myint avatar Jul 15 '18 16:07 myint

Ah, I got it. Thanks

      1. 오전 1:16 Steven Myint [email protected] 작성:

@seeeturtle One of the other PyCQA members needs to approve this before I can merge it. This is the case for several of the open pull requests.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

seeeturtle avatar Jul 15 '18 23:07 seeeturtle

done @jayvdb

seeeturtle avatar Dec 14 '18 16:12 seeeturtle

Will this ever get merged? It's been two years!

retnikt avatar Apr 28 '20 13:04 retnikt

Anything I can do to help push this over the finish line?

janosh avatar Oct 14 '21 15:10 janosh