Replies: 1 comment 1 reply
-
I think that you will have to write your own code that packages up a C function inside a capsule. This is functionality that could be realized on top of a nanobind-based binding, but nanobind's |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I am working on Python bindings for my C++ library which implements (among other stuff) something similar to numeric integration. I expect a Python user to provide me with a function callback mapping one float to another. Even than nanobind performance is a way better than pybind11 one currently, I expect that some users would like to use interface similar to one implemented in scipy (
scipy.LowLevelCallable
) when it is allowed to explicitly pass C-function, Cython function, Numba JIT-compiled or similar to the C side in order to further reduce Python overhead.How do I do similar in nanobind? pybind11 used to have shortcut for std::function cast, which I never tried though.
Beta Was this translation helpful? Give feedback.
All reactions