MCPcopy Create free account
hub / github.com/apache/arrow / BindFunction

Function BindFunction

python/pyarrow/src/arrow/python/common.h:332–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330
331template <typename OutFn, typename Return, typename... Args>
332std::function<OutFn> BindFunction(Return (*unbound)(PyObject*, Args...),
333 PyObject* bound_arg) {
334 using Fn = BoundFunction<Return(PyObject*, Args...)>;
335
336 static_assert(std::is_same<typename Fn::Bound, OutFn>::value,
337 "requested bound function of unsupported type");
338
339 Py_XINCREF(bound_arg);
340 auto bound_fn = std::make_shared<Fn>(unbound, bound_arg);
341 return
342 [bound_fn](Args... args) { return bound_fn->Invoke(std::forward<Args>(args)...); };
343}
344
345// A temporary conversion of a Python object to a bytes area.
346struct PyBytesView {

Callers

nothing calls this directly

Calls 1

InvokeMethod · 0.45

Tested by

no test coverage detected