py::object: docs / sources? #4252
Unanswered
RobG-LHind
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am new to pybind11.
I tried to find answers in https://pybind11.readthedocs.io/en/stable/.... and on stackoverflow, but I may have overlooked the obious: I do not find the sources of py::object (declaration, implementation) or a detailed documentation of py::object (attributes, methods).
Can someone give me a link?
aim:
In a C++ function/method I would like to modify a python-object of a non standard type (cv2.cuda_GpuMat), but I do not find any detailed information about py::object .
How do I check the type of the py::object / PyObject?
How do I get (/iterate over) pointer/references to attributes of the py::pbject / PyObject?
use case:
C++ library cppXXX exists.
Incomplete python wrapper pyXXX of cppXXX exists.
struct XXX::YYY{ void *data;}};
Python class XXX_YYY exists, there is *data (among other things) inside.
I would like to write a C++ function
void coPyYYY(XXX:YYY &cyyy, py::object &pyyy){
// copy cyyy.data to pyyy.data
// increase refcounter
// choose right policy for destructing
Beta Was this translation helpful? Give feedback.
All reactions