{"action":"created","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/6885","labels_url":"https://api.github.com/repos/numpy/numpy/issues/6885/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/6885/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/6885/events","html_url":"https://github.com/numpy/numpy/pull/6885","id":123763354,"number":6885,"title":"ENH: Expand Argument Range of random_integers","user":{"login":"gfyoung","id":9273653,"avatar_url":"https://avatars.githubusercontent.com/u/9273653?v=3","gravatar_id":"","url":"https://api.github.com/users/gfyoung","html_url":"https://github.com/gfyoung","followers_url":"https://api.github.com/users/gfyoung/followers","following_url":"https://api.github.com/users/gfyoung/following{/other_user}","gists_url":"https://api.github.com/users/gfyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/gfyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfyoung/subscriptions","organizations_url":"https://api.github.com/users/gfyoung/orgs","repos_url":"https://api.github.com/users/gfyoung/repos","events_url":"https://api.github.com/users/gfyoung/events{/privacy}","received_events_url":"https://api.github.com/users/gfyoung/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.random","name":"component: numpy.random","color":"ff0000"},{"url":"https://api.github.com/repos/numpy/numpy/labels/Enhancement","name":"Enhancement","color":"e102d8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-24T06:15:08Z","updated_at":"2015-12-28T19:10:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/6885","html_url":"https://github.com/numpy/numpy/pull/6885","diff_url":"https://github.com/numpy/numpy/pull/6885.diff","patch_url":"https://github.com/numpy/numpy/pull/6885.patch"},"body":"Redistributes the code between the ```randint``` and ```random_integers``` methods so that we can generate integers up to and including ```np.iinfo('l').max``` with ```random_integers```, which previously would have caused an ```OverflowError```.\r\n\r\nPrevious behavior:\r\n```\r\n>>> import numpy as np\r\n>>> np.random.random_integers(np.iinfo('l').max - 1, np.iinfo('l').max)\r\nTraceback (most recent call last):\r\n  File \"<pyshell#1>\", line 1, in <module>\r\n    np.random.random_integers(np.iinfo('l').max - 1, np.iinfo('l').max)\r\n  File \"mtrand.pyx\", line 1446, in mtrand.RandomState.random_integers (numpy\\random\\mtrand\\mtrand.c:12401)\r\n  File \"mtrand.pyx\", line 942, in mtrand.RandomState.randint (numpy\\random\\mtrand\\mtrand.c:9558)\r\nOverflowError: Python int too large to convert to C long\r\n```\r\n\r\nNew behavior:\r\n```\r\n>>> import numpy as np\r\n>>> np.random.random_integers(np.iinfo('l').max - 1, np.iinfo('l').max) # 32-bit Python\r\n2147483647\r\n```\r\n\r\n(Optional, But Recommended) Depends on #6824\r\n-\r\nWhile the PR currently allows for the generation of up to and including ```np.iinfo('l').max```, if #6824 is merged in, the PR will be revised to being able to generate random integers up to and including ```np.iinfo('ll').max```."},"comment":{"url":"https://api.github.com/repos/numpy/numpy/issues/comments/167630431","html_url":"https://github.com/numpy/numpy/pull/6885#issuecomment-167630431","issue_url":"https://api.github.com/repos/numpy/numpy/issues/6885","id":167630431,"user":{"login":"charris","id":77272,"avatar_url":"https://avatars.githubusercontent.com/u/77272?v=3","gravatar_id":"","url":"https://api.github.com/users/charris","html_url":"https://github.com/charris","followers_url":"https://api.github.com/users/charris/followers","following_url":"https://api.github.com/users/charris/following{/other_user}","gists_url":"https://api.github.com/users/charris/gists{/gist_id}","starred_url":"https://api.github.com/users/charris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charris/subscriptions","organizations_url":"https://api.github.com/users/charris/orgs","repos_url":"https://api.github.com/users/charris/repos","events_url":"https://api.github.com/users/charris/events{/privacy}","received_events_url":"https://api.github.com/users/charris/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T19:10:29Z","updated_at":"2015-12-28T19:10:29Z","body":"LGTM modulo a couple of nits."}}