{"action":"created","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/6681","repository_url":"https://api.github.com/repos/scipy/scipy","labels_url":"https://api.github.com/repos/scipy/scipy/issues/6681/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/6681/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/6681/events","html_url":"https://github.com/scipy/scipy/issues/6681","id":182854050,"number":6681,"title":"add a new context manager to wrap `scipy.special.seterr`","user":{"login":"ev-br","id":2133832,"avatar_url":"https://avatars.githubusercontent.com/u/2133832?v=3","gravatar_id":"","url":"https://api.github.com/users/ev-br","html_url":"https://github.com/ev-br","followers_url":"https://api.github.com/users/ev-br/followers","following_url":"https://api.github.com/users/ev-br/following{/other_user}","gists_url":"https://api.github.com/users/ev-br/gists{/gist_id}","starred_url":"https://api.github.com/users/ev-br/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev-br/subscriptions","organizations_url":"https://api.github.com/users/ev-br/orgs","repos_url":"https://api.github.com/users/ev-br/repos","events_url":"https://api.github.com/users/ev-br/events{/privacy}","received_events_url":"https://api.github.com/users/ev-br/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scipy/scipy/labels/enhancement","name":"enhancement","color":"bfe5bf"},{"url":"https://api.github.com/repos/scipy/scipy/labels/needs-decision","name":"needs-decision","color":"fbca04"},{"url":"https://api.github.com/repos/scipy/scipy/labels/scipy.special","name":"scipy.special","color":"207de5"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-10-13T17:41:28Z","updated_at":"2016-10-17T13:37:44Z","closed_at":null,"body":"TIL that `scipy.special.errprint` cannot be used as a context manager\r\n\r\n```\r\nIn [16]: with errprint(True):\r\n   ....:     print hyp2f1(0.5, 2/3., 1.5, 0.09j+0.75j)\r\n   ....:     \r\n---------------------------------------------------------------------------\r\nAttributeError                            Traceback (most recent call last)\r\n<ipython-input-16-c476ba18ca62> in <module>()\r\n----> 1 with errprint(True):\r\n      2     print hyp2f1(0.5, 2/3., 1.5, 0.09j+0.75j)\r\n      3 \r\n\r\nAttributeError: __exit__\r\n```\r\n\r\nGranted, it's not documented as such, so I guess here's an enhancement request to have a context manager similar to `numpy.errstate`, https://docs.scipy.org/doc/numpy/reference/generated/numpy.errstate.html"},"comment":{"url":"https://api.github.com/repos/scipy/scipy/issues/comments/254209551","html_url":"https://github.com/scipy/scipy/issues/6681#issuecomment-254209551","issue_url":"https://api.github.com/repos/scipy/scipy/issues/6681","id":254209551,"user":{"login":"person142","id":15134881,"avatar_url":"https://avatars.githubusercontent.com/u/15134881?v=3","gravatar_id":"","url":"https://api.github.com/users/person142","html_url":"https://github.com/person142","followers_url":"https://api.github.com/users/person142/followers","following_url":"https://api.github.com/users/person142/following{/other_user}","gists_url":"https://api.github.com/users/person142/gists{/gist_id}","starred_url":"https://api.github.com/users/person142/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/person142/subscriptions","organizations_url":"https://api.github.com/users/person142/orgs","repos_url":"https://api.github.com/users/person142/repos","events_url":"https://api.github.com/users/person142/events{/privacy}","received_events_url":"https://api.github.com/users/person142/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T13:37:44Z","updated_at":"2016-10-17T13:37:44Z","body":"> That, or make `sf_error` error handling thread-local (which probably should be done in any case), and maintain an \"sf_get_errno\" interface for getting the latest error code.\r\n\r\nActually started this over the weekend. :-) Means we have to start looking for openmp at compile time though (not fun). :-(\r\n\r\n> Alternatively, I can also see an argument for making each cython wrapper have a additional pointer return of `int *errno`.\r\n\r\nIn theory I like this better, but doing it would require touching every function in special..."}}
{"actor":{"display_login":"person142"}}