{"action":"created","issue":{"url":"https://api.github.com/repos/cython/cython/issues/2283","repository_url":"https://api.github.com/repos/cython/cython","labels_url":"https://api.github.com/repos/cython/cython/issues/2283/labels{/name}","comments_url":"https://api.github.com/repos/cython/cython/issues/2283/comments","events_url":"https://api.github.com/repos/cython/cython/issues/2283/events","html_url":"https://github.com/cython/cython/issues/2283","id":324644282,"number":2283,"title":"Type `long` maps to different numpy types in windows and linux","user":{"login":"david-cortes","id":11860098,"avatar_url":"https://avatars0.githubusercontent.com/u/11860098?v=4","gravatar_id":"","url":"https://api.github.com/users/david-cortes","html_url":"https://github.com/david-cortes","followers_url":"https://api.github.com/users/david-cortes/followers","following_url":"https://api.github.com/users/david-cortes/following{/other_user}","gists_url":"https://api.github.com/users/david-cortes/gists{/gist_id}","starred_url":"https://api.github.com/users/david-cortes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-cortes/subscriptions","organizations_url":"https://api.github.com/users/david-cortes/orgs","repos_url":"https://api.github.com/users/david-cortes/repos","events_url":"https://api.github.com/users/david-cortes/events{/privacy}","received_events_url":"https://api.github.com/users/david-cortes/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-19T17:02:33Z","updated_at":"2018-05-19T17:53:23Z","closed_at":"2018-05-19T17:53:23Z","author_association":"NONE","body":"When creating cython extensions in windows platforms, if I build a function taking as input a numpy array with type integer, the same `numpy.int32` and `numpy.int64` map to different C types in windows and linux. Particularly, in windows, the C type `long` matches to `numpy.int32`, whereas in linux it matches to `numpy.int64` - e.g. this function:\r\n```\r\ndef fc(np.ndarray[long, ndim=2] a):\r\n    return None\r\n```\r\n\r\nWould only accept an array with type `np.int32` in windows, and would only accept an array with type `np.int64` in linux (both 64-bit OSes). The type `double`, however, matches to `np.float64` under both.\r\n\r\nI'm not sure if this is related to the numpy build (I'm using the builds from clean anaconda installations), but it would be nice if it could match to the same types in different OSes, so as to make code more easily compatible across platforms.\r\n\r\nThe bug happens with Python 3.6."},"comment":{"url":"https://api.github.com/repos/cython/cython/issues/comments/390421714","html_url":"https://github.com/cython/cython/issues/2283#issuecomment-390421714","issue_url":"https://api.github.com/repos/cython/cython/issues/2283","id":390421714,"user":{"login":"robertwb","id":486017,"avatar_url":"https://avatars3.githubusercontent.com/u/486017?v=4","gravatar_id":"","url":"https://api.github.com/users/robertwb","html_url":"https://github.com/robertwb","followers_url":"https://api.github.com/users/robertwb/followers","following_url":"https://api.github.com/users/robertwb/following{/other_user}","gists_url":"https://api.github.com/users/robertwb/gists{/gist_id}","starred_url":"https://api.github.com/users/robertwb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertwb/subscriptions","organizations_url":"https://api.github.com/users/robertwb/orgs","repos_url":"https://api.github.com/users/robertwb/repos","events_url":"https://api.github.com/users/robertwb/events{/privacy}","received_events_url":"https://api.github.com/users/robertwb/received_events","type":"User","site_admin":false},"created_at":"2018-05-19T17:53:23Z","updated_at":"2018-05-19T17:53:23Z","author_association":"CONTRIBUTOR","body":"This is because long has a different size on these platforms. You can comport np.npy_int64 and friends to use a fixed size."}}
{"actor":{"display_login":"robertwb"}}