You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it different to call python function using
C++?
py::object ret = py_instance.attr(“call”)(pylist)
py_instance.attr(“call”)(pylist)
I just wonder whether this calls is synchronized or not, because I am worried about pylist is released by c++, and because pybind use reference pass as default (maybe?), it is possible to get empty object in python code.
But if I add a return value, c++ must wait for the python function returns, so pylist could not be released in advance.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi developers:
Is it different to call python function using
C++?
I just wonder whether this calls is synchronized or not, because I am worried about pylist is released by c++, and because pybind use reference pass as default (maybe?), it is possible to get empty object in python code.
But if I add a return value, c++ must wait for the python function returns, so pylist could not be released in advance.
Could anyone help to answer this question?
Beta Was this translation helpful? Give feedback.
All reactions