-
When porting from pybind11, aside from the major changes described in the porting guide I find smaller differences. For instance, pybind11::list() was taking the size arg for PyList_New:
and the corresponding constructor of nb::list doesn't:
I'm wondering, are such changes intentional (and too small to list them all in the docs), or just happened and should be raised/discussed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The discussion of differences between pybind11 and nanobind is mainly related to standard binding code but does not go into detail about each and every bit of wrapper API. In this particular case; those changes are intentional. The |
Beta Was this translation helpful? Give feedback.
The discussion of differences between pybind11 and nanobind is mainly related to standard binding code but does not go into detail about each and every bit of wrapper API.
In this particular case; those changes are intentional. The
explicit list(size_t)
constructor creates an invalid list object with null pointers, so it's kind of a weird API to wrap with C++. A similar issue also exists for tuples, which are generally not mutable, except after constructing an invalid one containing null pointers.