{"action":"created","issue":{"url":"https://api.github.com/repos/ipython/ipython/issues/11509","repository_url":"https://api.github.com/repos/ipython/ipython","labels_url":"https://api.github.com/repos/ipython/ipython/issues/11509/labels{/name}","comments_url":"https://api.github.com/repos/ipython/ipython/issues/11509/comments","events_url":"https://api.github.com/repos/ipython/ipython/issues/11509/events","html_url":"https://github.com/ipython/ipython/pull/11509","id":384123140,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNDAzNDMy","number":11509,"title":"Add new exception-reporting mode and %tb mode option.","user":{"login":"danielballan","id":2279598,"node_id":"MDQ6VXNlcjIyNzk1OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/2279598?v=4","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ipython/ipython/milestones/60","html_url":"https://github.com/ipython/ipython/milestone/60","labels_url":"https://api.github.com/repos/ipython/ipython/milestones/60/labels","id":3774114,"node_id":"MDk6TWlsZXN0b25lMzc3NDExNA==","number":60,"title":"7.2","description":"","creator":{"login":"Carreau","id":335567,"node_id":"MDQ6VXNlcjMzNTU2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/335567?v=4","gravatar_id":"","url":"https://api.github.com/users/Carreau","html_url":"https://github.com/Carreau","followers_url":"https://api.github.com/users/Carreau/followers","following_url":"https://api.github.com/users/Carreau/following{/other_user}","gists_url":"https://api.github.com/users/Carreau/gists{/gist_id}","starred_url":"https://api.github.com/users/Carreau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carreau/subscriptions","organizations_url":"https://api.github.com/users/Carreau/orgs","repos_url":"https://api.github.com/users/Carreau/repos","events_url":"https://api.github.com/users/Carreau/events{/privacy}","received_events_url":"https://api.github.com/users/Carreau/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":20,"state":"open","created_at":"2018-10-27T20:10:50Z","updated_at":"2018-11-30T01:07:48Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-11-25T21:55:19Z","updated_at":"2018-11-30T03:53:34Z","closed_at":"2018-11-29T02:45:09Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/ipython/ipython/pulls/11509","html_url":"https://github.com/ipython/ipython/pull/11509","diff_url":"https://github.com/ipython/ipython/pull/11509.diff","patch_url":"https://github.com/ipython/ipython/pull/11509.patch"},"body":"This adds a new mode to [`%xmode`](https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-xmode) tentatively named `'Minimal'` that shows only the exception --- no traceback.\r\n\r\n```python                                                                       \r\nIn [1]: %xmode minimal                                                          \r\nException reporting mode: Minimal                                               \r\n                                                                                \r\nIn [2]: def f():                                                                \r\n    ...:     3/0                                                                \r\n    ...:                                                                        \r\n                                                                                \r\nIn [3]: f()                                                                     \r\nZeroDivisionError: division by zero\r\n```\r\n\r\nIn many contexts, you might say this leaves out too much information. Here is the context that I feel this will be useful in. Novice Python users are using IPython to execute rote procedures in a framework that happens to produce very deep tracebacks. They are completely lost in / overwhelmed by the full tracebacks and --- during the short time they grabble with IPython --- unable to absorb the rule, \"Just scroll to the bottom.\" Therefore, an aggressively succinct `%xmode` setting may be less disorienting. Multiple experienced IPython users at my facility have suggested that this setting would be help elicit more useful bug reports.\r\n\r\nOf course, if the problem is not immediately clear, it will be essential to access the full traceback. This could be done by switching to a more verbose `%xmode` and then using `%tb` to show the most recent traceback. In order to streamline that, this PR also adds an optional parameter to `%tb` that temporarily switches the exception-reporting mode for that single use.\r\n\r\n```python\r\nIn [4]: %tb verbose                                                             \r\n---------------------------------------------------------------------------     \r\nZeroDivisionError                         Traceback (most recent call last)     \r\n<ipython-input-3-c43e34e6d405> in <module>                                      \r\n----> 1 f()                                                                     \r\n        global f = <function f at 0x10e52de18>                                  \r\n                                                                                \r\n<ipython-input-2-cd4172d70b5b> in f()                                           \r\n        1 def f():                                                               \r\n----> 2     3/0                                                                 \r\n        3                                                                       \r\n                                                                                \r\nZeroDivisionError: division by zero                                             \r\n                                                                                \r\nIn [5]: f()  # The default reporting mode has not been changed....              \r\nZeroDivisionError: division by zero\r\n```"},"comment":{"url":"https://api.github.com/repos/ipython/ipython/issues/comments/443082496","html_url":"https://github.com/ipython/ipython/pull/11509#issuecomment-443082496","issue_url":"https://api.github.com/repos/ipython/ipython/issues/11509","id":443082496,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzA4MjQ5Ng==","user":{"login":"Carreau","id":335567,"node_id":"MDQ6VXNlcjMzNTU2Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/335567?v=4","gravatar_id":"","url":"https://api.github.com/users/Carreau","html_url":"https://github.com/Carreau","followers_url":"https://api.github.com/users/Carreau/followers","following_url":"https://api.github.com/users/Carreau/following{/other_user}","gists_url":"https://api.github.com/users/Carreau/gists{/gist_id}","starred_url":"https://api.github.com/users/Carreau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carreau/subscriptions","organizations_url":"https://api.github.com/users/Carreau/orgs","repos_url":"https://api.github.com/users/Carreau/repos","events_url":"https://api.github.com/users/Carreau/events{/privacy}","received_events_url":"https://api.github.com/users/Carreau/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T03:53:34Z","updated_at":"2018-11-30T03:53:34Z","author_association":"MEMBER","body":"(and 7.2 is out, currently writing announcements)"}}
{"actor":{"display_login":"Carreau"}}