Support passing None where a unique_ptr<T> is needed (subject to argument nullability rules), and producing None when a null unique_ptr<T> is returned to Python.
Previously from-python conversion would pass a None object to nb_type_relinquish_ownership which would try to reinterpret it as a nanobind instance. Similarly, in from-cpp conversion, nb_type_put_unique would call nb_type_put_unique_finalize which would try to modify some bits in Py_None.
Support passing None where a
unique_ptr<T>
is needed (subject to argument nullability rules), and producing None when a nullunique_ptr<T>
is returned to Python.Previously from-python conversion would pass a None object to
nb_type_relinquish_ownership
which would try to reinterpret it as a nanobind instance. Similarly, in from-cpp conversion,nb_type_put_unique
would callnb_type_put_unique_finalize
which would try to modify some bits inPy_None
.