Skip to content

Create new PyObject from std::type_info and pointer #140

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

You must be logged in to vote

If it's primitive types, your best bet will be to iterate through all of the possibilities, static_cast in C++, and then call nb::cast. The nanobind data structures would only be helpful for types exposed using bindings (i.e. via nb::class_<T>), which isn't even possible for int etc.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@noahbkim
Comment options

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