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

Function pybind11_object_new

include/pybind11/detail/class.h:406–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404/// Instance creation function for all pybind11 types. It only allocates space for the
405/// C++ object, but doesn't call the constructor -- an `__init__` function must do that.
406extern "C" inline PyObject *pybind11_object_new(PyTypeObject *type, PyObject *, PyObject *) {
407 return make_new_instance(type);
408}
409
410/// An `__init__` function constructs the C++ object. Users should provide at least one
411/// of these using `py::init` or directly with `.def(__init__, ...)`. Otherwise, the

Callers

nothing calls this directly

Calls 1

make_new_instanceFunction · 0.85

Tested by

no test coverage detected