{"action":"created","issue":{"url":"https://api.github.com/repos/myint/pyflakes-test-no-labels/issues/51","repository_url":"https://api.github.com/repos/myint/pyflakes-test-no-labels","labels_url":"https://api.github.com/repos/myint/pyflakes-test-no-labels/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/myint/pyflakes-test-no-labels/issues/51/comments","events_url":"https://api.github.com/repos/myint/pyflakes-test-no-labels/issues/51/events","html_url":"https://github.com/myint/pyflakes-test-no-labels/issues/51","id":228594869,"number":51,"title":"Imports and methods fall in the same namespace?","user":{"login":"myint","id":1235108,"avatar_url":"https://avatars1.githubusercontent.com/u/1235108?v=3","gravatar_id":"","url":"https://api.github.com/users/myint","html_url":"https://github.com/myint","followers_url":"https://api.github.com/users/myint/followers","following_url":"https://api.github.com/users/myint/following{/other_user}","gists_url":"https://api.github.com/users/myint/gists{/gist_id}","starred_url":"https://api.github.com/users/myint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myint/subscriptions","organizations_url":"https://api.github.com/users/myint/orgs","repos_url":"https://api.github.com/users/myint/repos","events_url":"https://api.github.com/users/myint/events{/privacy}","received_events_url":"https://api.github.com/users/myint/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-15T02:59:10Z","updated_at":"2017-05-15T03:25:27Z","closed_at":null,"body":"Consider the following script:\n\nimport bar\n\nclass Foo:\n    def bar(self):\n        pass\n\nPyflakes emits:\n\n$ pyflakes foo.py \nfoo.py:1: 'bar' imported but unused\nfoo.py:4: redefinition of unused 'bar' from line 1\n\nBoth disappears if `bar` is actually used, so the following is clean:\n\nimport bar\n\nclass Foo:\n    def bar(self):\n        pass\n\ncoffee = bar.Espresso()"},"comment":{"url":"https://api.github.com/repos/myint/pyflakes-test-no-labels/issues/comments/301367834","html_url":"https://github.com/myint/pyflakes-test-no-labels/issues/51#issuecomment-301367834","issue_url":"https://api.github.com/repos/myint/pyflakes-test-no-labels/issues/51","id":301367834,"user":{"login":"myint","id":1235108,"avatar_url":"https://avatars1.githubusercontent.com/u/1235108?v=3","gravatar_id":"","url":"https://api.github.com/users/myint","html_url":"https://github.com/myint","followers_url":"https://api.github.com/users/myint/followers","following_url":"https://api.github.com/users/myint/following{/other_user}","gists_url":"https://api.github.com/users/myint/gists{/gist_id}","starred_url":"https://api.github.com/users/myint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myint/subscriptions","organizations_url":"https://api.github.com/users/myint/orgs","repos_url":"https://api.github.com/users/myint/repos","events_url":"https://api.github.com/users/myint/events{/privacy}","received_events_url":"https://api.github.com/users/myint/received_events","type":"User","site_admin":false},"created_at":"2017-05-15T03:25:27Z","updated_at":"2017-05-15T03:25:27Z","body":"*Original comment by lelegaifax on Launchpad:*\n\n------------------------------------\n\nWell, I don't agree with your argument, but if that's instead valid, then I would\nexpect that a very similar case, that is\n\ndef a():\n    pass\n\nclass A:\n    def a(self):\n        pass\n\nshould emit the same error instead of the current happy mood, and even\n\na = 1\n\ndef b():\n    a = 2\n\nshould \"warn\" me about the override of a global symbol within the function namespace,\ninstead of the current and IMHO correct warning about unused assignment.\n\nIn any case, the fact that the error \"disappear\" as soon as I use the imported symbol\nseems wrong: the class method is still overriding the global symbol."}}
{"actor":{"display_login":"myint"}}