-
Hi, I am trying to move to nanobind from pybind11. I used to make use of shared_ptr holders, but like the idea of the intrusive_base and using ref to wrap return values. I created a have a make static method (similar to the one in the unit test) and return a newly constructed value as a ref, but when calling in Python I get an error saying it is not possible to convert the ref type to a Python object. When I change to returning a TimeSeriesReference *, it works fine. Is there any special magic I am missing? My code is here:
From what I can see I think I have done all the things done in the unit test in nanobind. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
OK, after a bit more investigation, I think I figured out what I was doing wrong. I guess I would update the documentation to say "ALWAYS include nanobind.h before ref.h". |
Beta Was this translation helpful? Give feedback.
OK, after a bit more investigation, I think I figured out what I was doing wrong.
I had a few places where I had included ref.h without first importing nanobind.h.
Once doing this it resolves the problem.
I guess I would update the documentation to say "ALWAYS include nanobind.h before ref.h".