{"action":"created","comment":{"url":"https://api.github.com/repos/numba/numba/pulls/comments/41396397","id":41396397,"diff_hunk":"@@ -127,6 +141,30 @@ def __init__(self, symbol, cstring):\n         signature = templates.signature(self.restype, *self.argtypes)\n         super(ExternCFunction, self).__init__(symbol, signature)\n \n+\n+registry = templates.Registry()\n+\n+@registry.register\n+class FFI_from_buffer(templates.AbstractTemplate):\n+    key = cffi.FFI.from_buffer\n+\n+    def generic(self, args, kws):\n+        if kws or (len(args) != 1):\n+            return\n+        [ary] = args\n+        if not (isinstance(ary, types.Array) or ary.layout in ('C', 'F')):","path":"numba/typing/cffi_utils.py","position":50,"original_position":50,"commit_id":"cf0caac25e8a39221e6dc8121931fc992cbd4c60","original_commit_id":"cf0caac25e8a39221e6dc8121931fc992cbd4c60","user":{"login":"gmarkall","id":535640,"avatar_url":"https://avatars.githubusercontent.com/u/535640?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarkall","html_url":"https://github.com/gmarkall","followers_url":"https://api.github.com/users/gmarkall/followers","following_url":"https://api.github.com/users/gmarkall/following{/other_user}","gists_url":"https://api.github.com/users/gmarkall/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarkall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarkall/subscriptions","organizations_url":"https://api.github.com/users/gmarkall/orgs","repos_url":"https://api.github.com/users/gmarkall/repos","events_url":"https://api.github.com/users/gmarkall/events{/privacy}","received_events_url":"https://api.github.com/users/gmarkall/received_events","type":"User","site_admin":false},"body":"Whoops, yes, I do.","created_at":"2015-10-07T14:26:56Z","updated_at":"2015-10-07T14:26:56Z","html_url":"https://github.com/numba/numba/pull/1464#discussion_r41396397","pull_request_url":"https://api.github.com/repos/numba/numba/pulls/1464","_links":{"self":{"href":"https://api.github.com/repos/numba/numba/pulls/comments/41396397"},"html":{"href":"https://github.com/numba/numba/pull/1464#discussion_r41396397"},"pull_request":{"href":"https://api.github.com/repos/numba/numba/pulls/1464"}}},"pull_request":{"url":"https://api.github.com/repos/numba/numba/pulls/1464","id":47017476,"html_url":"https://github.com/numba/numba/pull/1464","diff_url":"https://github.com/numba/numba/pull/1464.diff","patch_url":"https://github.com/numba/numba/pull/1464.patch","issue_url":"https://api.github.com/repos/numba/numba/issues/1464","number":1464,"state":"open","locked":false,"title":"[WIP] Support cffi.FFI.from_buffer","user":{"login":"gmarkall","id":535640,"avatar_url":"https://avatars.githubusercontent.com/u/535640?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarkall","html_url":"https://github.com/gmarkall","followers_url":"https://api.github.com/users/gmarkall/followers","following_url":"https://api.github.com/users/gmarkall/following{/other_user}","gists_url":"https://api.github.com/users/gmarkall/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarkall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarkall/subscriptions","organizations_url":"https://api.github.com/users/gmarkall/orgs","repos_url":"https://api.github.com/users/gmarkall/repos","events_url":"https://api.github.com/users/gmarkall/events{/privacy}","received_events_url":"https://api.github.com/users/gmarkall/received_events","type":"User","site_admin":false},"body":"This can be used to pass contiguous Numpy arrays of float32 and\r\nfloat64 to C function parameters of types float* and double*\r\nrespectively.\r\n\r\nSome discussion/notes in #1443.","created_at":"2015-10-07T11:53:21Z","updated_at":"2015-10-07T14:26:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"368262968e3fa10b0a729e0f272525712950a509","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/numba/numba/pulls/1464/commits","review_comments_url":"https://api.github.com/repos/numba/numba/pulls/1464/comments","review_comment_url":"https://api.github.com/repos/numba/numba/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numba/numba/issues/1464/comments","statuses_url":"https://api.github.com/repos/numba/numba/statuses/cf0caac25e8a39221e6dc8121931fc992cbd4c60","head":{"label":"gmarkall:ffi_from_buffer","ref":"ffi_from_buffer","sha":"cf0caac25e8a39221e6dc8121931fc992cbd4c60","user":{"login":"gmarkall","id":535640,"avatar_url":"https://avatars.githubusercontent.com/u/535640?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarkall","html_url":"https://github.com/gmarkall","followers_url":"https://api.github.com/users/gmarkall/followers","following_url":"https://api.github.com/users/gmarkall/following{/other_user}","gists_url":"https://api.github.com/users/gmarkall/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarkall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarkall/subscriptions","organizations_url":"https://api.github.com/users/gmarkall/orgs","repos_url":"https://api.github.com/users/gmarkall/repos","events_url":"https://api.github.com/users/gmarkall/events{/privacy}","received_events_url":"https://api.github.com/users/gmarkall/received_events","type":"User","site_admin":false},"repo":{"id":25310096,"name":"numba","full_name":"gmarkall/numba","owner":{"login":"gmarkall","id":535640,"avatar_url":"https://avatars.githubusercontent.com/u/535640?v=3","gravatar_id":"","url":"https://api.github.com/users/gmarkall","html_url":"https://github.com/gmarkall","followers_url":"https://api.github.com/users/gmarkall/followers","following_url":"https://api.github.com/users/gmarkall/following{/other_user}","gists_url":"https://api.github.com/users/gmarkall/gists{/gist_id}","starred_url":"https://api.github.com/users/gmarkall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmarkall/subscriptions","organizations_url":"https://api.github.com/users/gmarkall/orgs","repos_url":"https://api.github.com/users/gmarkall/repos","events_url":"https://api.github.com/users/gmarkall/events{/privacy}","received_events_url":"https://api.github.com/users/gmarkall/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gmarkall/numba","description":"NumPy aware dynamic Python compiler using LLVM","fork":true,"url":"https://api.github.com/repos/gmarkall/numba","forks_url":"https://api.github.com/repos/gmarkall/numba/forks","keys_url":"https://api.github.com/repos/gmarkall/numba/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gmarkall/numba/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gmarkall/numba/teams","hooks_url":"https://api.github.com/repos/gmarkall/numba/hooks","issue_events_url":"https://api.github.com/repos/gmarkall/numba/issues/events{/number}","events_url":"https://api.github.com/repos/gmarkall/numba/events","assignees_url":"https://api.github.com/repos/gmarkall/numba/assignees{/user}","branches_url":"https://api.github.com/repos/gmarkall/numba/branches{/branch}","tags_url":"https://api.github.com/repos/gmarkall/numba/tags","blobs_url":"https://api.github.com/repos/gmarkall/numba/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gmarkall/numba/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gmarkall/numba/git/refs{/sha}","trees_url":"https://api.github.com/repos/gmarkall/numba/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gmarkall/numba/statuses/{sha}","languages_url":"https://api.github.com/repos/gmarkall/numba/languages","stargazers_url":"https://api.github.com/repos/gmarkall/numba/stargazers","contributors_url":"https://api.github.com/repos/gmarkall/numba/contributors","subscribers_url":"https://api.github.com/repos/gmarkall/numba/subscribers","subscription_url":"https://api.github.com/repos/gmarkall/numba/subscription","commits_url":"https://api.github.com/repos/gmarkall/numba/commits{/sha}","git_commits_url":"https://api.github.com/repos/gmarkall/numba/git/commits{/sha}","comments_url":"https://api.github.com/repos/gmarkall/numba/comments{/number}","issue_comment_url":"https://api.github.com/repos/gmarkall/numba/issues/comments{/number}","contents_url":"https://api.github.com/repos/gmarkall/numba/contents/{+path}","compare_url":"https://api.github.com/repos/gmarkall/numba/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gmarkall/numba/merges","archive_url":"https://api.github.com/repos/gmarkall/numba/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gmarkall/numba/downloads","issues_url":"https://api.github.com/repos/gmarkall/numba/issues{/number}","pulls_url":"https://api.github.com/repos/gmarkall/numba/pulls{/number}","milestones_url":"https://api.github.com/repos/gmarkall/numba/milestones{/number}","notifications_url":"https://api.github.com/repos/gmarkall/numba/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gmarkall/numba/labels{/name}","releases_url":"https://api.github.com/repos/gmarkall/numba/releases{/id}","created_at":"2014-10-16T16:04:09Z","updated_at":"2015-05-08T08:41:16Z","pushed_at":"2015-10-07T13:19:36Z","git_url":"git://github.com/gmarkall/numba.git","ssh_url":"git@github.com:gmarkall/numba.git","clone_url":"https://github.com/gmarkall/numba.git","svn_url":"https://github.com/gmarkall/numba","homepage":"","size":20788,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"numba:master","ref":"master","sha":"50249d4c9d84b091e9a8764e15b7f089a5cac10e","user":{"login":"numba","id":1628082,"avatar_url":"https://avatars.githubusercontent.com/u/1628082?v=3","gravatar_id":"","url":"https://api.github.com/users/numba","html_url":"https://github.com/numba","followers_url":"https://api.github.com/users/numba/followers","following_url":"https://api.github.com/users/numba/following{/other_user}","gists_url":"https://api.github.com/users/numba/gists{/gist_id}","starred_url":"https://api.github.com/users/numba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numba/subscriptions","organizations_url":"https://api.github.com/users/numba/orgs","repos_url":"https://api.github.com/users/numba/repos","events_url":"https://api.github.com/users/numba/events{/privacy}","received_events_url":"https://api.github.com/users/numba/received_events","type":"Organization","site_admin":false},"repo":{"id":3659275,"name":"numba","full_name":"numba/numba","owner":{"login":"numba","id":1628082,"avatar_url":"https://avatars.githubusercontent.com/u/1628082?v=3","gravatar_id":"","url":"https://api.github.com/users/numba","html_url":"https://github.com/numba","followers_url":"https://api.github.com/users/numba/followers","following_url":"https://api.github.com/users/numba/following{/other_user}","gists_url":"https://api.github.com/users/numba/gists{/gist_id}","starred_url":"https://api.github.com/users/numba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numba/subscriptions","organizations_url":"https://api.github.com/users/numba/orgs","repos_url":"https://api.github.com/users/numba/repos","events_url":"https://api.github.com/users/numba/events{/privacy}","received_events_url":"https://api.github.com/users/numba/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/numba/numba","description":"NumPy aware dynamic Python compiler using LLVM","fork":false,"url":"https://api.github.com/repos/numba/numba","forks_url":"https://api.github.com/repos/numba/numba/forks","keys_url":"https://api.github.com/repos/numba/numba/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numba/numba/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numba/numba/teams","hooks_url":"https://api.github.com/repos/numba/numba/hooks","issue_events_url":"https://api.github.com/repos/numba/numba/issues/events{/number}","events_url":"https://api.github.com/repos/numba/numba/events","assignees_url":"https://api.github.com/repos/numba/numba/assignees{/user}","branches_url":"https://api.github.com/repos/numba/numba/branches{/branch}","tags_url":"https://api.github.com/repos/numba/numba/tags","blobs_url":"https://api.github.com/repos/numba/numba/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numba/numba/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numba/numba/git/refs{/sha}","trees_url":"https://api.github.com/repos/numba/numba/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numba/numba/statuses/{sha}","languages_url":"https://api.github.com/repos/numba/numba/languages","stargazers_url":"https://api.github.com/repos/numba/numba/stargazers","contributors_url":"https://api.github.com/repos/numba/numba/contributors","subscribers_url":"https://api.github.com/repos/numba/numba/subscribers","subscription_url":"https://api.github.com/repos/numba/numba/subscription","commits_url":"https://api.github.com/repos/numba/numba/commits{/sha}","git_commits_url":"https://api.github.com/repos/numba/numba/git/commits{/sha}","comments_url":"https://api.github.com/repos/numba/numba/comments{/number}","issue_comment_url":"https://api.github.com/repos/numba/numba/issues/comments{/number}","contents_url":"https://api.github.com/repos/numba/numba/contents/{+path}","compare_url":"https://api.github.com/repos/numba/numba/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numba/numba/merges","archive_url":"https://api.github.com/repos/numba/numba/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numba/numba/downloads","issues_url":"https://api.github.com/repos/numba/numba/issues{/number}","pulls_url":"https://api.github.com/repos/numba/numba/pulls{/number}","milestones_url":"https://api.github.com/repos/numba/numba/milestones{/number}","notifications_url":"https://api.github.com/repos/numba/numba/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numba/numba/labels{/name}","releases_url":"https://api.github.com/repos/numba/numba/releases{/id}","created_at":"2012-03-08T11:12:43Z","updated_at":"2015-10-05T21:30:30Z","pushed_at":"2015-10-07T13:19:37Z","git_url":"git://github.com/numba/numba.git","ssh_url":"git@github.com:numba/numba.git","clone_url":"https://github.com/numba/numba.git","svn_url":"https://github.com/numba/numba","homepage":"http://numba.pydata.org/","size":36704,"stargazers_count":1578,"watchers_count":1578,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":168,"mirror_url":null,"open_issues_count":197,"forks":168,"open_issues":197,"watchers":1578,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numba/numba/pulls/1464"},"html":{"href":"https://github.com/numba/numba/pull/1464"},"issue":{"href":"https://api.github.com/repos/numba/numba/issues/1464"},"comments":{"href":"https://api.github.com/repos/numba/numba/issues/1464/comments"},"review_comments":{"href":"https://api.github.com/repos/numba/numba/pulls/1464/comments"},"review_comment":{"href":"https://api.github.com/repos/numba/numba/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numba/numba/pulls/1464/commits"},"statuses":{"href":"https://api.github.com/repos/numba/numba/statuses/cf0caac25e8a39221e6dc8121931fc992cbd4c60"}}}}