{"action":"created","issue":{"url":"https://api.github.com/repos/Almenon/AREPL-vscode/issues/82","repository_url":"https://api.github.com/repos/Almenon/AREPL-vscode","labels_url":"https://api.github.com/repos/Almenon/AREPL-vscode/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/Almenon/AREPL-vscode/issues/82/comments","events_url":"https://api.github.com/repos/Almenon/AREPL-vscode/issues/82/events","html_url":"https://github.com/Almenon/AREPL-vscode/issues/82","id":341276316,"node_id":"MDU6SXNzdWUzNDEyNzYzMTY=","number":82,"title":"arepl does not update when user changes a imported file","user":{"login":"Almenon","id":13080965,"node_id":"MDQ6VXNlcjEzMDgwOTY1","avatar_url":"https://avatars0.githubusercontent.com/u/13080965?v=4","gravatar_id":"","url":"https://api.github.com/users/Almenon","html_url":"https://github.com/Almenon","followers_url":"https://api.github.com/users/Almenon/followers","following_url":"https://api.github.com/users/Almenon/following{/other_user}","gists_url":"https://api.github.com/users/Almenon/gists{/gist_id}","starred_url":"https://api.github.com/users/Almenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Almenon/subscriptions","organizations_url":"https://api.github.com/users/Almenon/orgs","repos_url":"https://api.github.com/users/Almenon/repos","events_url":"https://api.github.com/users/Almenon/events{/privacy}","received_events_url":"https://api.github.com/users/Almenon/received_events","type":"User","site_admin":false},"labels":[{"id":804780316,"node_id":"MDU6TGFiZWw4MDQ3ODAzMTY=","url":"https://api.github.com/repos/Almenon/AREPL-vscode/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":{"login":"Almenon","id":13080965,"node_id":"MDQ6VXNlcjEzMDgwOTY1","avatar_url":"https://avatars0.githubusercontent.com/u/13080965?v=4","gravatar_id":"","url":"https://api.github.com/users/Almenon","html_url":"https://github.com/Almenon","followers_url":"https://api.github.com/users/Almenon/followers","following_url":"https://api.github.com/users/Almenon/following{/other_user}","gists_url":"https://api.github.com/users/Almenon/gists{/gist_id}","starred_url":"https://api.github.com/users/Almenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Almenon/subscriptions","organizations_url":"https://api.github.com/users/Almenon/orgs","repos_url":"https://api.github.com/users/Almenon/repos","events_url":"https://api.github.com/users/Almenon/events{/privacy}","received_events_url":"https://api.github.com/users/Almenon/received_events","type":"User","site_admin":false},"assignees":[{"login":"Almenon","id":13080965,"node_id":"MDQ6VXNlcjEzMDgwOTY1","avatar_url":"https://avatars0.githubusercontent.com/u/13080965?v=4","gravatar_id":"","url":"https://api.github.com/users/Almenon","html_url":"https://github.com/Almenon","followers_url":"https://api.github.com/users/Almenon/followers","following_url":"https://api.github.com/users/Almenon/following{/other_user}","gists_url":"https://api.github.com/users/Almenon/gists{/gist_id}","starred_url":"https://api.github.com/users/Almenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Almenon/subscriptions","organizations_url":"https://api.github.com/users/Almenon/orgs","repos_url":"https://api.github.com/users/Almenon/repos","events_url":"https://api.github.com/users/Almenon/events{/privacy}","received_events_url":"https://api.github.com/users/Almenon/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Almenon/AREPL-vscode/milestones/14","html_url":"https://github.com/Almenon/AREPL-vscode/milestone/14","labels_url":"https://api.github.com/repos/Almenon/AREPL-vscode/milestones/14/labels","id":3526952,"node_id":"MDk6TWlsZXN0b25lMzUyNjk1Mg==","number":14,"title":"v0.1.4","description":"","creator":{"login":"Almenon","id":13080965,"node_id":"MDQ6VXNlcjEzMDgwOTY1","avatar_url":"https://avatars0.githubusercontent.com/u/13080965?v=4","gravatar_id":"","url":"https://api.github.com/users/Almenon","html_url":"https://github.com/Almenon","followers_url":"https://api.github.com/users/Almenon/followers","following_url":"https://api.github.com/users/Almenon/following{/other_user}","gists_url":"https://api.github.com/users/Almenon/gists{/gist_id}","starred_url":"https://api.github.com/users/Almenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Almenon/subscriptions","organizations_url":"https://api.github.com/users/Almenon/orgs","repos_url":"https://api.github.com/users/Almenon/repos","events_url":"https://api.github.com/users/Almenon/events{/privacy}","received_events_url":"https://api.github.com/users/Almenon/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":3,"state":"open","created_at":"2018-07-27T03:01:49Z","updated_at":"2018-08-29T05:43:00Z","due_on":"2018-09-23T07:00:00Z","closed_at":null},"comments":8,"created_at":"2018-07-14T22:46:30Z","updated_at":"2018-08-30T01:06:04Z","closed_at":null,"author_association":"OWNER","body":"When a user imports a file they created and changes the code while arepl is running, they expect a different result to appear in arepl.  Instead of the imported code is stuck in the exact same state it was at the start of the arepl session.  \r\n\r\nThis is because of the import caching I found out about in #74, but I didn't realize it went this far.\r\n\r\n**Reproduction steps:**\r\n\r\n1. Create two files, A.py and B.py in the same folder\r\n2. in A.py paste the following:\r\n```python\r\ndef foo(): return 5\r\n```\r\n3. in B.py paste the following:\r\n```python\r\nfrom A import foo\r\nprint(foo()*2)\r\n```\r\n4. invoke AREPL and you should see 10 printed\r\n5. change A to return 10 and save\r\n6. trigger a arepl run (via edit or save)\r\n7. expected result: 20  actual result: still 10\r\n\r\n**Workaround:**\r\n\r\nmanually delete the import.  Easy to do but I shouldn't expect users to know they have to do this.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Almenon/AREPL-vscode/issues/comments/417156271","html_url":"https://github.com/Almenon/AREPL-vscode/issues/82#issuecomment-417156271","issue_url":"https://api.github.com/repos/Almenon/AREPL-vscode/issues/82","id":417156271,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzE1NjI3MQ==","user":{"login":"Almenon","id":13080965,"node_id":"MDQ6VXNlcjEzMDgwOTY1","avatar_url":"https://avatars0.githubusercontent.com/u/13080965?v=4","gravatar_id":"","url":"https://api.github.com/users/Almenon","html_url":"https://github.com/Almenon","followers_url":"https://api.github.com/users/Almenon/followers","following_url":"https://api.github.com/users/Almenon/following{/other_user}","gists_url":"https://api.github.com/users/Almenon/gists{/gist_id}","starred_url":"https://api.github.com/users/Almenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Almenon/subscriptions","organizations_url":"https://api.github.com/users/Almenon/orgs","repos_url":"https://api.github.com/users/Almenon/repos","events_url":"https://api.github.com/users/Almenon/events{/privacy}","received_events_url":"https://api.github.com/users/Almenon/received_events","type":"User","site_admin":false},"created_at":"2018-08-30T01:06:04Z","updated_at":"2018-08-30T01:06:04Z","author_association":"OWNER","body":"I've thought about it some more and I'm pretty sure that's all I needed.  sys.modules contains all the imported modules, so that's all I need to find imports.  For example, python's internal module loading code uses sys.modules:\r\n\r\nhttps://github.com/python/cpython/blob/3.7/Lib/importlib/__init__.py\r\n\r\nThere's also the documentation:\r\n\r\nhttps://docs.python.org/3/library/sys.html#sys.modules\r\n\r\nThe only wierd thing is why sys.modules contains builtins like math that have not been imported yet, but for my case builtins can be left cached anyways."}}
{"actor":{"display_login":"Almenon"}}