In [1]:
%load_ext ipybind
In [2]:
%pybind11_capture
%pybind11_capture
%pybind11_capture on
%pybind11_capture off
%pybind11_capture 1
%pybind11_capture 0
In [3]:
%%pybind11 -f;
PYBIND11_PLUGIN(test) {
py::module m("test");
m.attr("x") = py::cast(1);
m.attr("_y") = py::cast(2);
m.attr("__z") = py::cast(3);
return m.ptr();
}
In [4]:
assert x == 1
assert _y == 2
assert '__z' not in globals()