31 py::class_<VirtClass, PyVirtClass>(
m,
"VirtClass")
36 m.def(
"test_callback_py_obj", [](py::object &
func) {
func(); });
37 m.def(
"test_callback_std_func", [](
const std::function<
void()> &func) {
func(); });
40 m.def(
"test_cross_module_gil", []() {
41 auto cm = py::module_::import(
"cross_module_gil_utils");
42 auto gil_acquire =
reinterpret_cast<void (*)()
>(
43 PyLong_AsVoidPtr(
cm.attr(
"gil_acquire_funcaddr").ptr()));
44 py::gil_scoped_release gil_release;
TEST_SUBMODULE(gil_scoped, m)
void virtual_func() override
void pure_virtual_func() override
#define PYBIND11_OVERRIDE(ret_type, cname, fn,...)
virtual ~VirtClass()=default
#define PYBIND11_OVERRIDE_PURE(ret_type, cname, fn,...)
virtual void pure_virtual_func()=0
virtual void virtual_func()