{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/ipython/issues/11325","repository_url":"https://api.github.com/repos/ipython/ipython","labels_url":"https://api.github.com/repos/ipython/ipython/issues/11325/labels{/name}","comments_url":"https://api.github.com/repos/ipython/ipython/issues/11325/comments","events_url":"https://api.github.com/repos/ipython/ipython/issues/11325/events","html_url":"https://github.com/ipython/ipython/issues/11325","id":361832341,"node_id":"MDU6SXNzdWUzNjE4MzIzNDE=","number":11325,"title":"Inconsistent underscore behavior in IPython","user":{"login":"reckoner","id":173637,"node_id":"MDQ6VXNlcjE3MzYzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/173637?v=4","gravatar_id":"","url":"https://api.github.com/users/reckoner","html_url":"https://github.com/reckoner","followers_url":"https://api.github.com/users/reckoner/followers","following_url":"https://api.github.com/users/reckoner/following{/other_user}","gists_url":"https://api.github.com/users/reckoner/gists{/gist_id}","starred_url":"https://api.github.com/users/reckoner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reckoner/subscriptions","organizations_url":"https://api.github.com/users/reckoner/orgs","repos_url":"https://api.github.com/users/reckoner/repos","events_url":"https://api.github.com/users/reckoner/events{/privacy}","received_events_url":"https://api.github.com/users/reckoner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-19T16:37:40Z","updated_at":"2018-09-24T14:15:19Z","closed_at":null,"author_association":"NONE","body":"    Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19)\r\n    Type 'copyright', 'credits' or 'license' for more information\r\n    IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.\r\n\r\n    In [1]: _,a=1,10\r\n\r\n    In [2]: _\r\n    Out[2]: 1\r\n\r\n    In [3]: 1/3\r\n    Out[3]: 0.3333333333333333\r\n\r\n    In [4]: _\r\n    Out[4]: 0.3333333333333333\r\n\r\n\r\n\r\n\r\n    In [5]: _,a = 1,10\r\n\r\n    In [6]: _\r\n    Out[6]: 1\r\n\r\n    In [7]: 1/3\r\n    Out[7]: 0.3333333333333333\r\n\r\n    In [8]: _\r\n    Out[8]: 1\r\n\r\n Is there some reason that `Out[8]` should not match `Out[4]`?\r\n\r\nI originally thought this was a Jupyter Notebook issue (https://github.com/jupyter/notebook/issues/3943) but now I think it is an IPython Issue."},"comment":{"url":"https://api.github.com/repos/ipython/ipython/issues/comments/423989894","html_url":"https://github.com/ipython/ipython/issues/11325#issuecomment-423989894","issue_url":"https://api.github.com/repos/ipython/ipython/issues/11325","id":423989894,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzk4OTg5NA==","user":{"login":"minrk","id":151929,"node_id":"MDQ6VXNlcjE1MTkyOQ==","avatar_url":"https://avatars1.githubusercontent.com/u/151929?v=4","gravatar_id":"","url":"https://api.github.com/users/minrk","html_url":"https://github.com/minrk","followers_url":"https://api.github.com/users/minrk/followers","following_url":"https://api.github.com/users/minrk/following{/other_user}","gists_url":"https://api.github.com/users/minrk/gists{/gist_id}","starred_url":"https://api.github.com/users/minrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minrk/subscriptions","organizations_url":"https://api.github.com/users/minrk/orgs","repos_url":"https://api.github.com/users/minrk/repos","events_url":"https://api.github.com/users/minrk/events{/privacy}","received_events_url":"https://api.github.com/users/minrk/received_events","type":"User","site_admin":false},"created_at":"2018-09-24T14:15:19Z","updated_at":"2018-09-24T14:15:19Z","author_association":"MEMBER","body":"There is a bug here, and it's the behavior in the first example. IPython only intends to create the `_` variable *if you haven't defined it*. So if you do `_, a = 1, 10`, that disables the `_` as an alias for ` Out[max(Out.keys())]` because your code has explicitly defined what `_` should mean. This is the behavior you are seeing later on in your session. There appears to be a bug where we don't trigger this \"don't override user-defined `_`\" logic correctly if your assignment to `_` happens in the first input."}}
{"actor":{"display_login":"minrk"}}