{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/7859","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/7859/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/7859/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/7859/events","html_url":"https://github.com/numpy/numpy/pull/7859","id":166808856,"number":7859,"title":"Adding a type check to set_printoptions()","user":{"login":"theultimatecrouton","id":20444824,"avatar_url":"https://avatars.githubusercontent.com/u/20444824?v=3","gravatar_id":"","url":"https://api.github.com/users/theultimatecrouton","html_url":"https://github.com/theultimatecrouton","followers_url":"https://api.github.com/users/theultimatecrouton/followers","following_url":"https://api.github.com/users/theultimatecrouton/following{/other_user}","gists_url":"https://api.github.com/users/theultimatecrouton/gists{/gist_id}","starred_url":"https://api.github.com/users/theultimatecrouton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theultimatecrouton/subscriptions","organizations_url":"https://api.github.com/users/theultimatecrouton/orgs","repos_url":"https://api.github.com/users/theultimatecrouton/repos","events_url":"https://api.github.com/users/theultimatecrouton/events{/privacy}","received_events_url":"https://api.github.com/users/theultimatecrouton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-07-21T12:39:05Z","updated_at":"2016-07-22T19:38:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/7859","html_url":"https://github.com/numpy/numpy/pull/7859","diff_url":"https://github.com/numpy/numpy/pull/7859.diff","patch_url":"https://github.com/numpy/numpy/pull/7859.patch"},"body":"See issue #7852.\r\n\r\nWe raise a TypeError if the first argument isn't of the expected type. Not very Pythonic, but otherwise set_printoptions() doesn't fail, but will cause any subsequent calls to print() to fail with an opaque error. In particular someone could mistakenly pass a dict (rather than an unpacked dict)."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/234636566","html_url":"https://github.com/numpy/numpy/pull/7859#issuecomment-234636566","issue_url":"https://api.github.com/repos/numpy/numpy/issues/7859","id":234636566,"user":{"login":"njsmith","id":609896,"avatar_url":"https://avatars.githubusercontent.com/u/609896?v=3","gravatar_id":"","url":"https://api.github.com/users/njsmith","html_url":"https://github.com/njsmith","followers_url":"https://api.github.com/users/njsmith/followers","following_url":"https://api.github.com/users/njsmith/following{/other_user}","gists_url":"https://api.github.com/users/njsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/njsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/njsmith/subscriptions","organizations_url":"https://api.github.com/users/njsmith/orgs","repos_url":"https://api.github.com/users/njsmith/repos","events_url":"https://api.github.com/users/njsmith/events{/privacy}","received_events_url":"https://api.github.com/users/njsmith/received_events","type":"User","site_admin":false},"created_at":"2016-07-22T19:38:08Z","updated_at":"2016-07-22T19:38:08Z","body":"> reason it might be desirable is to explain why there is only type-checking on the one argument\r\n\r\nWell, yes, exactly ;-)\r\n\r\nFor adding a test: tests are just functions whose name starts with `test_`, and that live in one of the test files, and that call `assert_*` functions to check things. There are probably some tests for printing already; if you grep for the string \"printoptions\" then you'll probably find the right place to add your test. Here you'll want to use `assert_raises` (again, grep will find you other examples in the codebase), and to run the tests just run `./runtests.py` in the root of your checkout. (Plus tests will also be run automatically when you push new changes to the PR.)"}}
{"actor":{"display_login":"njsmith"}}