{"action":"created","issue":{"url":"https://api.github.com/repos/numba/numba/issues/938","labels_url":"https://api.github.com/repos/numba/numba/issues/938/labels{/name}","comments_url":"https://api.github.com/repos/numba/numba/issues/938/comments","events_url":"https://api.github.com/repos/numba/numba/issues/938/events","html_url":"https://github.com/numba/numba/issues/938","id":54371355,"number":938,"title":"Problem with nonlocal variables","user":{"login":"da-woods","id":10536947,"avatar_url":"https://avatars.githubusercontent.com/u/10536947?v=3","gravatar_id":"","url":"https://api.github.com/users/da-woods","html_url":"https://github.com/da-woods","followers_url":"https://api.github.com/users/da-woods/followers","following_url":"https://api.github.com/users/da-woods/following{/other_user}","gists_url":"https://api.github.com/users/da-woods/gists{/gist_id}","starred_url":"https://api.github.com/users/da-woods/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/da-woods/subscriptions","organizations_url":"https://api.github.com/users/da-woods/orgs","repos_url":"https://api.github.com/users/da-woods/repos","events_url":"https://api.github.com/users/da-woods/events{/privacy}","received_events_url":"https://api.github.com/users/da-woods/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-14T20:21:05Z","updated_at":"2015-01-14T22:54:51Z","closed_at":"2015-01-14T22:54:51Z","body":"Simple example:\r\n\r\n    from numba import jit\r\n    def run():\r\n      @jit\r\n      def f(a):\r\n        return n*a\r\n      for n in range(5):\r\n        print f(n)\r\n\r\nprints five 0s. The pure python version correctly prints 0,1,4,9,16. This is using numba version 0.16.0, and python version 2.7.8.\r\n\r\nI suspect it has to do with n being an integer (thus immutable) and so being re-assigned rather than modified in the loop. I don't know though.\r\n\r\nI don't think this is a major problem - in most cases this can be fixed by passing another argument, and I could imagine the fix could be a lot slower. It's mostly just a notice that it doesn't quite work, and possibly it should be noted in the documentation somewhere."},"comment":{"url":"https://api.github.com/repos/numba/numba/issues/comments/70009330","html_url":"https://github.com/numba/numba/issues/938#issuecomment-70009330","issue_url":"https://api.github.com/repos/numba/numba/issues/938","id":70009330,"user":{"login":"pitrou","id":1721820,"avatar_url":"https://avatars.githubusercontent.com/u/1721820?v=3","gravatar_id":"","url":"https://api.github.com/users/pitrou","html_url":"https://github.com/pitrou","followers_url":"https://api.github.com/users/pitrou/followers","following_url":"https://api.github.com/users/pitrou/following{/other_user}","gists_url":"https://api.github.com/users/pitrou/gists{/gist_id}","starred_url":"https://api.github.com/users/pitrou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitrou/subscriptions","organizations_url":"https://api.github.com/users/pitrou/orgs","repos_url":"https://api.github.com/users/pitrou/repos","events_url":"https://api.github.com/users/pitrou/events{/privacy}","received_events_url":"https://api.github.com/users/pitrou/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T22:54:51Z","updated_at":"2015-01-14T22:54:51Z","body":"Closing as won't fix (we may want to do better one day, just not now :-))."}}