{"action":"opened","issue":{"url":"https://api.github.com/repos/brython-dev/brython/issues/183","labels_url":"https://api.github.com/repos/brython-dev/brython/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/brython-dev/brython/issues/183/comments","events_url":"https://api.github.com/repos/brython-dev/brython/issues/183/events","html_url":"https://github.com/brython-dev/brython/issues/183","id":73264876,"number":183,"title":"Discrepancy between exec'ing a Python string and a compiled code object visavis context dictionary ","user":{"login":"rbarve","id":4059955,"avatar_url":"https://avatars.githubusercontent.com/u/4059955?v=3","gravatar_id":"","url":"https://api.github.com/users/rbarve","html_url":"https://github.com/rbarve","followers_url":"https://api.github.com/users/rbarve/followers","following_url":"https://api.github.com/users/rbarve/following{/other_user}","gists_url":"https://api.github.com/users/rbarve/gists{/gist_id}","starred_url":"https://api.github.com/users/rbarve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbarve/subscriptions","organizations_url":"https://api.github.com/users/rbarve/orgs","repos_url":"https://api.github.com/users/rbarve/repos","events_url":"https://api.github.com/users/rbarve/events{/privacy}","received_events_url":"https://api.github.com/users/rbarve/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-05T09:49:07Z","updated_at":"2015-05-05T09:49:07Z","closed_at":null,"body":"I find an inconsistency between a compiled code object being exec'd and an unpreprocessed code statement being exec'd in regards to the update of accompanying context dictionary --\r\n\r\nBrython 3.1.1 on Netscape 5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.39 Safari/537.36\r\n\r\nx=4\r\ncd=dict(globals())\r\ncd.update(locals())\r\nexec(\"x=x+4\",cd)\r\nx\r\n4\r\ncd['x']\r\n8\r\ny=5\r\nyd=dict(globals())\r\nyd.update(locals())\r\nco=compile(\"y=y+4\",\"\",\"exec\")\r\nexec(co,yd)\r\n9\r\nyd['y']\r\n5\r\n\r\n\r\nIn CPython:\r\nPython 2.7.6 (default, Mar 22 2014, 22:59:56) \r\n[GCC 4.8.2] on linux2\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\r\nx=4\r\ncd=dict(globals())\r\ncd.update(locals())\r\nexec(\"x=x+4\",cd)\r\nx\r\n4\r\ncd['x']\r\n8\r\ny=5\r\nyd=dict(globals())\r\nyd.update(locals())\r\nco=compile(\"y=y+4\",\"\",\"exec\")\r\nexec(co,yd)\r\nyd['y']\r\n9\r\ny\r\n5"}}