MCPcopy Create free account
hub / github.com/pybind/pybind11 / get_function

Function get_function

include/pybind11/pytypes.h:961–970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

959
960PYBIND11_NAMESPACE_BEGIN(detail)
961inline handle get_function(handle value) {
962 if (value) {
963 if (PyInstanceMethod_Check(value.ptr())) {
964 value = PyInstanceMethod_GET_FUNCTION(value.ptr());
965 } else if (PyMethod_Check(value.ptr())) {
966 value = PyMethod_GET_FUNCTION(value.ptr());
967 }
968 }
969 return value;
970}
971
972// Reimplementation of python's dict helper functions to ensure that exceptions
973// aren't swallowed (see #2862)

Callers 2

get_function_recordMethod · 0.85
cpp_functionMethod · 0.85

Calls 1

ptrMethod · 0.80

Tested by

no test coverage detected