Skip to content

nb::list constructor #641

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

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wojdyr
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