{"action":"created","issue":{"url":"https://api.github.com/repos/pybind/pybind11/issues/1413","repository_url":"https://api.github.com/repos/pybind/pybind11","labels_url":"https://api.github.com/repos/pybind/pybind11/issues/1413/labels{/name}","comments_url":"https://api.github.com/repos/pybind/pybind11/issues/1413/comments","events_url":"https://api.github.com/repos/pybind/pybind11/issues/1413/events","html_url":"https://github.com/pybind/pybind11/pull/1413","id":326731059,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwNzM3OTI5","number":1413,"title":"Allow python builtins to be used as callbacks","user":{"login":"davidhewitt","id":1939362,"node_id":"MDQ6VXNlcjE5MzkzNjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1939362?v=4","gravatar_id":"","url":"https://api.github.com/users/davidhewitt","html_url":"https://github.com/davidhewitt","followers_url":"https://api.github.com/users/davidhewitt/followers","following_url":"https://api.github.com/users/davidhewitt/following{/other_user}","gists_url":"https://api.github.com/users/davidhewitt/gists{/gist_id}","starred_url":"https://api.github.com/users/davidhewitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidhewitt/subscriptions","organizations_url":"https://api.github.com/users/davidhewitt/orgs","repos_url":"https://api.github.com/users/davidhewitt/repos","events_url":"https://api.github.com/users/davidhewitt/events{/privacy}","received_events_url":"https://api.github.com/users/davidhewitt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-26T11:25:58Z","updated_at":"2018-08-13T13:01:40Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/pybind/pybind11/pulls/1413","html_url":"https://github.com/pybind/pybind11/pull/1413","diff_url":"https://github.com/pybind/pybind11/pull/1413.diff","patch_url":"https://github.com/pybind/pybind11/pull/1413.patch"},"body":"At the moment when passing python builtins like `sum()` as callback functions to c++, the std::function caster will fail with `RuntimeError: Unable to extract capsule contents`. This is because of the machinery to extract stateless c++ function pointers to avoid the c++ -> python -> c++ overhead.\r\n\r\nI've added a simple check that the definition being extracted is indeed a capsule and an accompanying test that I can now use `sum()` as a callback. Hope you find this useful."},"comment":{"url":"https://api.github.com/repos/pybind/pybind11/issues/comments/412509849","html_url":"https://github.com/pybind/pybind11/pull/1413#issuecomment-412509849","issue_url":"https://api.github.com/repos/pybind/pybind11/issues/1413","id":412509849,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjUwOTg0OQ==","user":{"login":"TobiasBruell","id":5463214,"node_id":"MDQ6VXNlcjU0NjMyMTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/5463214?v=4","gravatar_id":"","url":"https://api.github.com/users/TobiasBruell","html_url":"https://github.com/TobiasBruell","followers_url":"https://api.github.com/users/TobiasBruell/followers","following_url":"https://api.github.com/users/TobiasBruell/following{/other_user}","gists_url":"https://api.github.com/users/TobiasBruell/gists{/gist_id}","starred_url":"https://api.github.com/users/TobiasBruell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TobiasBruell/subscriptions","organizations_url":"https://api.github.com/users/TobiasBruell/orgs","repos_url":"https://api.github.com/users/TobiasBruell/repos","events_url":"https://api.github.com/users/TobiasBruell/events{/privacy}","received_events_url":"https://api.github.com/users/TobiasBruell/received_events","type":"User","site_admin":false},"created_at":"2018-08-13T13:01:40Z","updated_at":"2018-08-13T13:01:40Z","author_association":"NONE","body":"I just ran into the same problem. Many thanks!"}}
{"actor":{"display_login":"TobiasBruell"}}