{"action":"created","comment":{"url":"https://api.github.com/repos/Semmle/ql/pulls/comments/332025385","pull_request_review_id":298136613,"id":332025385,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMjAyNTM4NQ==","diff_hunk":"@@ -0,0 +1,36 @@\n+\n+# FPs involving nonlocal\n+\n+def nonlocal_fp():\n+    test = False\n+    def set_test():\n+        nonlocal test\n+        test = True\n+    set_test()\n+    if test:\n+        print(\"Test is set.\")\n+\n+nonlocal_fp()","path":"python/ql/test/query-tests/Variables/unused_local_nonlocal/variables_test.py","position":13,"original_position":13,"commit_id":"26da6a1178b492860b5c3ddf4971efd9841538e9","original_commit_id":"26da6a1178b492860b5c3ddf4971efd9841538e9","user":{"login":"RasmusWL","id":1054041,"node_id":"MDQ6VXNlcjEwNTQwNDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1054041?v=4","gravatar_id":"","url":"https://api.github.com/users/RasmusWL","html_url":"https://github.com/RasmusWL","followers_url":"https://api.github.com/users/RasmusWL/followers","following_url":"https://api.github.com/users/RasmusWL/following{/other_user}","gists_url":"https://api.github.com/users/RasmusWL/gists{/gist_id}","starred_url":"https://api.github.com/users/RasmusWL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RasmusWL/subscriptions","organizations_url":"https://api.github.com/users/RasmusWL/orgs","repos_url":"https://api.github.com/users/RasmusWL/repos","events_url":"https://api.github.com/users/RasmusWL/events{/privacy}","received_events_url":"https://api.github.com/users/RasmusWL/received_events","type":"User","site_admin":false},"body":"nitpick: Did you intend to leave the this function call in here?","created_at":"2019-10-07T13:44:00Z","updated_at":"2019-10-07T13:46:03Z","html_url":"https://github.com/Semmle/ql/pull/2079#discussion_r332025385","pull_request_url":"https://api.github.com/repos/Semmle/ql/pulls/2079","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Semmle/ql/pulls/comments/332025385"},"html":{"href":"https://github.com/Semmle/ql/pull/2079#discussion_r332025385"},"pull_request":{"href":"https://api.github.com/repos/Semmle/ql/pulls/2079"}}},"pull_request":{"url":"https://api.github.com/repos/Semmle/ql/pulls/2079","id":324292587,"node_id":"MDExOlB1bGxSZXF1ZXN0MzI0MjkyNTg3","html_url":"https://github.com/Semmle/ql/pull/2079","diff_url":"https://github.com/Semmle/ql/pull/2079.diff","patch_url":"https://github.com/Semmle/ql/pull/2079.patch","issue_url":"https://api.github.com/repos/Semmle/ql/issues/2079","number":2079,"state":"open","locked":false,"title":"Python: Teach `py/unused-local-variable` about `nonlocal`.","user":{"login":"taus-semmle","id":45175834,"node_id":"MDQ6VXNlcjQ1MTc1ODM0","avatar_url":"https://avatars3.githubusercontent.com/u/45175834?v=4","gravatar_id":"","url":"https://api.github.com/users/taus-semmle","html_url":"https://github.com/taus-semmle","followers_url":"https://api.github.com/users/taus-semmle/followers","following_url":"https://api.github.com/users/taus-semmle/following{/other_user}","gists_url":"https://api.github.com/users/taus-semmle/gists{/gist_id}","starred_url":"https://api.github.com/users/taus-semmle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taus-semmle/subscriptions","organizations_url":"https://api.github.com/users/taus-semmle/orgs","repos_url":"https://api.github.com/users/taus-semmle/repos","events_url":"https://api.github.com/users/taus-semmle/events{/privacy}","received_events_url":"https://api.github.com/users/taus-semmle/received_events","type":"User","site_admin":false},"body":"Fairly straight-forward. If a local variable is marked as `nonlocal`, then it's reasonable to assume that it will be used non-locally (and thus \"useless\" assignments may in fact be useful after all).\r\n\r\nA more fine-grained analysis would link up the two variables so that we can verify that there is indeed an access of the variable in the outer scope. This will require a larger extension of the SSA code, however, and will have to be future work for now.","created_at":"2019-10-03T16:04:48Z","updated_at":"2019-10-07T13:46:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"768250086770f8af7506ccf2ee0c82aee8586ada","assignee":{"login":"RasmusWL","id":1054041,"node_id":"MDQ6VXNlcjEwNTQwNDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1054041?v=4","gravatar_id":"","url":"https://api.github.com/users/RasmusWL","html_url":"https://github.com/RasmusWL","followers_url":"https://api.github.com/users/RasmusWL/followers","following_url":"https://api.github.com/users/RasmusWL/following{/other_user}","gists_url":"https://api.github.com/users/RasmusWL/gists{/gist_id}","starred_url":"https://api.github.com/users/RasmusWL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RasmusWL/subscriptions","organizations_url":"https://api.github.com/users/RasmusWL/orgs","repos_url":"https://api.github.com/users/RasmusWL/repos","events_url":"https://api.github.com/users/RasmusWL/events{/privacy}","received_events_url":"https://api.github.com/users/RasmusWL/received_events","type":"User","site_admin":false},"assignees":[{"login":"RasmusWL","id":1054041,"node_id":"MDQ6VXNlcjEwNTQwNDE=","avatar_url":"https://avatars0.githubusercontent.com/u/1054041?v=4","gravatar_id":"","url":"https://api.github.com/users/RasmusWL","html_url":"https://github.com/RasmusWL","followers_url":"https://api.github.com/users/RasmusWL/followers","following_url":"https://api.github.com/users/RasmusWL/following{/other_user}","gists_url":"https://api.github.com/users/RasmusWL/gists{/gist_id}","starred_url":"https://api.github.com/users/RasmusWL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RasmusWL/subscriptions","organizations_url":"https://api.github.com/users/RasmusWL/orgs","repos_url":"https://api.github.com/users/RasmusWL/repos","events_url":"https://api.github.com/users/RasmusWL/events{/privacy}","received_events_url":"https://api.github.com/users/RasmusWL/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1136760357,"node_id":"MDU6TGFiZWwxMTM2NzYwMzU3","url":"https://api.github.com/repos/Semmle/ql/labels/Python","name":"Python","color":"1021b7","default":false},{"id":1019698289,"node_id":"MDU6TGFiZWwxMDE5Njk4Mjg5","url":"https://api.github.com/repos/Semmle/ql/labels/depends%20on%20internal%20PR","name":"depends on internal PR","color":"f9e69f","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Semmle/ql/pulls/2079/commits","review_comments_url":"https://api.github.com/repos/Semmle/ql/pulls/2079/comments","review_comment_url":"https://api.github.com/repos/Semmle/ql/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Semmle/ql/issues/2079/comments","statuses_url":"https://api.github.com/repos/Semmle/ql/statuses/26da6a1178b492860b5c3ddf4971efd9841538e9","head":{"label":"taus-semmle:python-unused-local-nonlocal","ref":"python-unused-local-nonlocal","sha":"26da6a1178b492860b5c3ddf4971efd9841538e9","user":{"login":"taus-semmle","id":45175834,"node_id":"MDQ6VXNlcjQ1MTc1ODM0","avatar_url":"https://avatars3.githubusercontent.com/u/45175834?v=4","gravatar_id":"","url":"https://api.github.com/users/taus-semmle","html_url":"https://github.com/taus-semmle","followers_url":"https://api.github.com/users/taus-semmle/followers","following_url":"https://api.github.com/users/taus-semmle/following{/other_user}","gists_url":"https://api.github.com/users/taus-semmle/gists{/gist_id}","starred_url":"https://api.github.com/users/taus-semmle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taus-semmle/subscriptions","organizations_url":"https://api.github.com/users/taus-semmle/orgs","repos_url":"https://api.github.com/users/taus-semmle/repos","events_url":"https://api.github.com/users/taus-semmle/events{/privacy}","received_events_url":"https://api.github.com/users/taus-semmle/received_events","type":"User","site_admin":false},"repo":{"id":158252986,"node_id":"MDEwOlJlcG9zaXRvcnkxNTgyNTI5ODY=","name":"ql","full_name":"taus-semmle/ql","private":false,"owner":{"login":"taus-semmle","id":45175834,"node_id":"MDQ6VXNlcjQ1MTc1ODM0","avatar_url":"https://avatars3.githubusercontent.com/u/45175834?v=4","gravatar_id":"","url":"https://api.github.com/users/taus-semmle","html_url":"https://github.com/taus-semmle","followers_url":"https://api.github.com/users/taus-semmle/followers","following_url":"https://api.github.com/users/taus-semmle/following{/other_user}","gists_url":"https://api.github.com/users/taus-semmle/gists{/gist_id}","starred_url":"https://api.github.com/users/taus-semmle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taus-semmle/subscriptions","organizations_url":"https://api.github.com/users/taus-semmle/orgs","repos_url":"https://api.github.com/users/taus-semmle/repos","events_url":"https://api.github.com/users/taus-semmle/events{/privacy}","received_events_url":"https://api.github.com/users/taus-semmle/received_events","type":"User","site_admin":false},"html_url":"https://github.com/taus-semmle/ql","description":"The standard QL libraries and queries that power LGTM.com and other Semmle Products","fork":true,"url":"https://api.github.com/repos/taus-semmle/ql","forks_url":"https://api.github.com/repos/taus-semmle/ql/forks","keys_url":"https://api.github.com/repos/taus-semmle/ql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/taus-semmle/ql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/taus-semmle/ql/teams","hooks_url":"https://api.github.com/repos/taus-semmle/ql/hooks","issue_events_url":"https://api.github.com/repos/taus-semmle/ql/issues/events{/number}","events_url":"https://api.github.com/repos/taus-semmle/ql/events","assignees_url":"https://api.github.com/repos/taus-semmle/ql/assignees{/user}","branches_url":"https://api.github.com/repos/taus-semmle/ql/branches{/branch}","tags_url":"https://api.github.com/repos/taus-semmle/ql/tags","blobs_url":"https://api.github.com/repos/taus-semmle/ql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/taus-semmle/ql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/taus-semmle/ql/git/refs{/sha}","trees_url":"https://api.github.com/repos/taus-semmle/ql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/taus-semmle/ql/statuses/{sha}","languages_url":"https://api.github.com/repos/taus-semmle/ql/languages","stargazers_url":"https://api.github.com/repos/taus-semmle/ql/stargazers","contributors_url":"https://api.github.com/repos/taus-semmle/ql/contributors","subscribers_url":"https://api.github.com/repos/taus-semmle/ql/subscribers","subscription_url":"https://api.github.com/repos/taus-semmle/ql/subscription","commits_url":"https://api.github.com/repos/taus-semmle/ql/commits{/sha}","git_commits_url":"https://api.github.com/repos/taus-semmle/ql/git/commits{/sha}","comments_url":"https://api.github.com/repos/taus-semmle/ql/comments{/number}","issue_comment_url":"https://api.github.com/repos/taus-semmle/ql/issues/comments{/number}","contents_url":"https://api.github.com/repos/taus-semmle/ql/contents/{+path}","compare_url":"https://api.github.com/repos/taus-semmle/ql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/taus-semmle/ql/merges","archive_url":"https://api.github.com/repos/taus-semmle/ql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/taus-semmle/ql/downloads","issues_url":"https://api.github.com/repos/taus-semmle/ql/issues{/number}","pulls_url":"https://api.github.com/repos/taus-semmle/ql/pulls{/number}","milestones_url":"https://api.github.com/repos/taus-semmle/ql/milestones{/number}","notifications_url":"https://api.github.com/repos/taus-semmle/ql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/taus-semmle/ql/labels{/name}","releases_url":"https://api.github.com/repos/taus-semmle/ql/releases{/id}","deployments_url":"https://api.github.com/repos/taus-semmle/ql/deployments","created_at":"2018-11-19T16:03:22Z","updated_at":"2019-09-23T09:58:07Z","pushed_at":"2019-10-03T15:59:08Z","git_url":"git://github.com/taus-semmle/ql.git","ssh_url":"git@github.com:taus-semmle/ql.git","clone_url":"https://github.com/taus-semmle/ql.git","svn_url":"https://github.com/taus-semmle/ql","homepage":"https://semmle.com/ql","size":29656,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Semmle:master","ref":"master","sha":"48dee29620890b35eba34b534676b6acdbd4086c","user":{"login":"Semmle","id":1101495,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMDE0OTU=","avatar_url":"https://avatars0.githubusercontent.com/u/1101495?v=4","gravatar_id":"","url":"https://api.github.com/users/Semmle","html_url":"https://github.com/Semmle","followers_url":"https://api.github.com/users/Semmle/followers","following_url":"https://api.github.com/users/Semmle/following{/other_user}","gists_url":"https://api.github.com/users/Semmle/gists{/gist_id}","starred_url":"https://api.github.com/users/Semmle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Semmle/subscriptions","organizations_url":"https://api.github.com/users/Semmle/orgs","repos_url":"https://api.github.com/users/Semmle/repos","events_url":"https://api.github.com/users/Semmle/events{/privacy}","received_events_url":"https://api.github.com/users/Semmle/received_events","type":"Organization","site_admin":false},"repo":{"id":143040428,"node_id":"MDEwOlJlcG9zaXRvcnkxNDMwNDA0Mjg=","name":"ql","full_name":"Semmle/ql","private":false,"owner":{"login":"Semmle","id":1101495,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExMDE0OTU=","avatar_url":"https://avatars0.githubusercontent.com/u/1101495?v=4","gravatar_id":"","url":"https://api.github.com/users/Semmle","html_url":"https://github.com/Semmle","followers_url":"https://api.github.com/users/Semmle/followers","following_url":"https://api.github.com/users/Semmle/following{/other_user}","gists_url":"https://api.github.com/users/Semmle/gists{/gist_id}","starred_url":"https://api.github.com/users/Semmle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Semmle/subscriptions","organizations_url":"https://api.github.com/users/Semmle/orgs","repos_url":"https://api.github.com/users/Semmle/repos","events_url":"https://api.github.com/users/Semmle/events{/privacy}","received_events_url":"https://api.github.com/users/Semmle/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Semmle/ql","description":"The standard QL libraries and queries that power LGTM.com and other Semmle Products","fork":false,"url":"https://api.github.com/repos/Semmle/ql","forks_url":"https://api.github.com/repos/Semmle/ql/forks","keys_url":"https://api.github.com/repos/Semmle/ql/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Semmle/ql/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Semmle/ql/teams","hooks_url":"https://api.github.com/repos/Semmle/ql/hooks","issue_events_url":"https://api.github.com/repos/Semmle/ql/issues/events{/number}","events_url":"https://api.github.com/repos/Semmle/ql/events","assignees_url":"https://api.github.com/repos/Semmle/ql/assignees{/user}","branches_url":"https://api.github.com/repos/Semmle/ql/branches{/branch}","tags_url":"https://api.github.com/repos/Semmle/ql/tags","blobs_url":"https://api.github.com/repos/Semmle/ql/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Semmle/ql/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Semmle/ql/git/refs{/sha}","trees_url":"https://api.github.com/repos/Semmle/ql/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Semmle/ql/statuses/{sha}","languages_url":"https://api.github.com/repos/Semmle/ql/languages","stargazers_url":"https://api.github.com/repos/Semmle/ql/stargazers","contributors_url":"https://api.github.com/repos/Semmle/ql/contributors","subscribers_url":"https://api.github.com/repos/Semmle/ql/subscribers","subscription_url":"https://api.github.com/repos/Semmle/ql/subscription","commits_url":"https://api.github.com/repos/Semmle/ql/commits{/sha}","git_commits_url":"https://api.github.com/repos/Semmle/ql/git/commits{/sha}","comments_url":"https://api.github.com/repos/Semmle/ql/comments{/number}","issue_comment_url":"https://api.github.com/repos/Semmle/ql/issues/comments{/number}","contents_url":"https://api.github.com/repos/Semmle/ql/contents/{+path}","compare_url":"https://api.github.com/repos/Semmle/ql/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Semmle/ql/merges","archive_url":"https://api.github.com/repos/Semmle/ql/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Semmle/ql/downloads","issues_url":"https://api.github.com/repos/Semmle/ql/issues{/number}","pulls_url":"https://api.github.com/repos/Semmle/ql/pulls{/number}","milestones_url":"https://api.github.com/repos/Semmle/ql/milestones{/number}","notifications_url":"https://api.github.com/repos/Semmle/ql/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Semmle/ql/labels{/name}","releases_url":"https://api.github.com/repos/Semmle/ql/releases{/id}","deployments_url":"https://api.github.com/repos/Semmle/ql/deployments","created_at":"2018-07-31T16:35:51Z","updated_at":"2019-10-07T12:28:40Z","pushed_at":"2019-10-07T13:32:32Z","git_url":"git://github.com/Semmle/ql.git","ssh_url":"git@github.com:Semmle/ql.git","clone_url":"https://github.com/Semmle/ql.git","svn_url":"https://github.com/Semmle/ql","homepage":"https://semmle.com/ql","size":30224,"stargazers_count":273,"watchers_count":273,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":103,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":101,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":103,"open_issues":101,"watchers":273,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Semmle/ql/pulls/2079"},"html":{"href":"https://github.com/Semmle/ql/pull/2079"},"issue":{"href":"https://api.github.com/repos/Semmle/ql/issues/2079"},"comments":{"href":"https://api.github.com/repos/Semmle/ql/issues/2079/comments"},"review_comments":{"href":"https://api.github.com/repos/Semmle/ql/pulls/2079/comments"},"review_comment":{"href":"https://api.github.com/repos/Semmle/ql/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Semmle/ql/pulls/2079/commits"},"statuses":{"href":"https://api.github.com/repos/Semmle/ql/statuses/26da6a1178b492860b5c3ddf4971efd9841538e9"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"RasmusWL"}}