Replies: 1 comment
-
The builtin type caster will generate a list. The most efficient way is to write this yourself using Python C API. nb::object r = nb::steal(PyTuple_New(size));
for (Py_ssize_t i = 0; i < size; ++i)
NB_TUPLE_SET_ITEM(r.ptr(), i, nb::cast(...).release().ptr()); |
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
-
I need to convert a variable length std::vector to a python tuple. What is the most efficient way to do this?
Beta Was this translation helpful? Give feedback.
All reactions