Replies: 1 comment
-
I've worked around it for now by explicitly creating the holder when passing an object back into a Python call. This should be fine for my purposes, since I'm doing code generation anyway, but it seems like it's either not working as intended or not clearly documented? (I'll add that I did eventually find the third argument to |
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm wrapping up a type that is non-allocatable, but trivially copyable. (Why the authors did this I have no idea, but I'm not in a position to change their mind.)
Approximated:
Because it cannot be allocated on the heap directly, pybind11 won't project it properly. So I create a holder for it:
But now when I pass it into a Python function, it raises a runtime exception "return_value_policy = copy, but type Object is non-copyable!".
The exception is coming from here in the stack (I have two different types in this call - there are actually hundreds of
Object
for me to worry about).Any tips on how to make sure my types get converted property when passing into a Python call?
Beta Was this translation helpful? Give feedback.
All reactions