{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/ipython/issues/8918","labels_url":"https://api.github.com/repos/ipython/ipython/issues/8918/labels{/name}","comments_url":"https://api.github.com/repos/ipython/ipython/issues/8918/comments","events_url":"https://api.github.com/repos/ipython/ipython/issues/8918/events","html_url":"https://github.com/ipython/ipython/issues/8918","id":112371697,"number":8918,"title":"NameError in list comprehension when using embed","user":{"login":"mathieulongtin","id":617359,"avatar_url":"https://avatars.githubusercontent.com/u/617359?v=3","gravatar_id":"","url":"https://api.github.com/users/mathieulongtin","html_url":"https://github.com/mathieulongtin","followers_url":"https://api.github.com/users/mathieulongtin/followers","following_url":"https://api.github.com/users/mathieulongtin/following{/other_user}","gists_url":"https://api.github.com/users/mathieulongtin/gists{/gist_id}","starred_url":"https://api.github.com/users/mathieulongtin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathieulongtin/subscriptions","organizations_url":"https://api.github.com/users/mathieulongtin/orgs","repos_url":"https://api.github.com/users/mathieulongtin/repos","events_url":"https://api.github.com/users/mathieulongtin/events{/privacy}","received_events_url":"https://api.github.com/users/mathieulongtin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-20T13:42:32Z","updated_at":"2015-10-21T14:02:58Z","closed_at":null,"body":"This used to work, and stopped working somewhere around six months to a year ago.\r\n\r\n```\r\nIn [51]: from os.path import getsize\r\n\r\nIn [52]: ziplen = dict((_, getsize(_)) for _ in zips)\r\n---------------------------------------------------------------------------\r\nNameError                                 Traceback (most recent call last)\r\n/nrg1/tools/datateam/packages/nuance.com/nvc4-pipeline-utils/nvc4qless.py in <module>()\r\n----> 1 ziplen = dict((_, getsize(_)) for _ in zips)\r\n\r\n/nrg1/tools/datateam/packages/nuance.com/nvc4-pipeline-utils/nvc4qless.py in <genexpr>((_,))\r\n----> 1 ziplen = dict((_, getsize(_)) for _ in zips)\r\n\r\nNameError: global name 'getsize' is not defined\r\n```\r\n\r\n`zips` is a list of paths, but this happens for list comprehension all over the place. Not sure what local/global namespace the list comprehension doesn't get.\r\n"},"comment":{"url":"https://api.github.com/repos/ipython/ipython/issues/comments/149905901","html_url":"https://github.com/ipython/ipython/issues/8918#issuecomment-149905901","issue_url":"https://api.github.com/repos/ipython/ipython/issues/8918","id":149905901,"user":{"login":"mathieulongtin","id":617359,"avatar_url":"https://avatars.githubusercontent.com/u/617359?v=3","gravatar_id":"","url":"https://api.github.com/users/mathieulongtin","html_url":"https://github.com/mathieulongtin","followers_url":"https://api.github.com/users/mathieulongtin/followers","following_url":"https://api.github.com/users/mathieulongtin/following{/other_user}","gists_url":"https://api.github.com/users/mathieulongtin/gists{/gist_id}","starred_url":"https://api.github.com/users/mathieulongtin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathieulongtin/subscriptions","organizations_url":"https://api.github.com/users/mathieulongtin/orgs","repos_url":"https://api.github.com/users/mathieulongtin/repos","events_url":"https://api.github.com/users/mathieulongtin/events{/privacy}","received_events_url":"https://api.github.com/users/mathieulongtin/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T14:02:58Z","updated_at":"2015-10-21T14:02:58Z","body":"It turns out `import IPython; IPython.start_ipython(user_ns=...)` works as expected, however it loads startup files, which is not necessarily what I wanted."}}