Skip to content

Interoperate between pybind11 and nanobind? #83

Answered by wjakob
qnzhou asked this question in Q&A
Discussion options

You must be logged in to vote

It's a hard limitation. nanobind can access a pybind11 object as generic Python object (in the sense of duck typing) and vice versa, but you won't be able to safely unpack it and do C++ calls. Having a tighter coupling would require sharing internal data structures between libraries, and that would ruin the point of nanobind (which is to avoid the complexity of pybind11's internal data structures).

I will also point out that interop is impossible even between various pybind11 and compiler versions, which illustrates how hard/messy this is.

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by qnzhou
Comment options

You must be logged in to vote
4 replies
@qnzhou
Comment options

@wbthomason
Comment options

@wjakob
Comment options

@wbthomason
Comment options

Comment options

You must be logged in to vote
2 replies
@wjakob
Comment options

@qnzhou
Comment options

Comment options

You must be logged in to vote
3 replies
@mikelui
Comment options

@wjakob
Comment options

@oremanj
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants