----------------------------
New features
^^^^^^^^^^^^
* The nd-array class :cpp:class:`nb::ndarray\<T\> <ndarray>` now supports
complex-valued ``T`` (e.g., ``std::complex<double>``). For this, the header
file ``nanobind/stl/complex.h`` must be included. (PR `319
<https://github.com/wjakob/nanobind/pull/319>`__, commit `6cbd13
<https://github.com/wjakob/nanobind/commit/6cbd1387753ea8f519ac0fe2242f0a54dd670ede>`__).
* Added the function :cpp:func:`nb::del() <del>`, which takes an arbitrary
accessor object as input and tries to delete the associated entry.
The C++ statement
.. code-block:: cpp
nb::del(o[key]);
is equivalent to ``del o[key]`` in Python. (commit `4dd745
<https://github.com/wjakob/nanobind/commit/4dd74596ac7b0f850cb0144f42a438124b91720c>`__).
* Exposed several convenience functions for raising exceptions as public API:
:cpp:func:`nb::raise <raise>`, :cpp:func:`nb::raise_type_error
<raise_type_error>`, and :cpp:func:`nb::raise_python_error
<raise_python_error>`. (commit `0b7f3b
<https://github.com/wjakob/nanobind/commit/0b7f3b1d2a182bda8b95826a3f98cc3e2d0402db>`__).
* Added :cpp:func:`nb::globals() <globals>`. (PR `311
<https://github.com/wjakob/nanobind/pull/311>`__, commit `f0a9eb
<https://github.com/wjakob/nanobind/commit/f0a9ebd9cd384ac554312247526b120102563e53>`__).
* The ``char*`` type caster now accepts ``nullptr`` and converts it into a
Python ``None`` object. (PR `318
<https://github.com/wjakob/nanobind/pull/317>`__, commit `30a6ba
<https://github.com/wjakob/nanobind/commit/30a6bac97a89bfafad82c2c5b6ef4516c00c35d6>`__).
* Added the function :cpp:func:`nb::is_alive() <is_alive>`, which returns
``false`` when nanobind was destructed by Python (e.g., during interpreter
shutdown) making further use of the API illegal. (commit `b431d0
<https://github.com/wjakob/nanobind/commit/b431d040f7b0585e9901856ee6c9b72281a37fa8>`__).
* Minor fixes and improvements.
* ABI version 11.
Bugfixes
^^^^^^^^
* The behavior of the :cpp:class:`nb::keep_alive\<Nurse, Patient\>
<keep_alive>` function binding annotation was changed as follows: when the
function call requires the implicit conversion of an argument, the lifetime
constraint now applies to the newly produced argument instead of the original
object. The change was rolled into a minor release since the former behavior
is arguably undesirable and dangerous. (commit `9d4b2e
<https://github.com/wjakob/nanobind/commit/9d4b2e317dbf32efab4ed41b6c275f9dbbbcf29f>`__).
* STL type casters previously raised an exception when casting a Python container
containing a ``None`` element into a C++ container that was not able to
represent ``nullptr`` (e.g., ``std::vector<T>`` instead of
``std::vector<T*>``). However, this exception was raised in a context where
exceptions were not allowed, causing the process to be ``abort()``-ed, which
is very bad. This issue is now fixed, and such conversions are refused. (PR
`318 <https://github.com/wjakob/nanobind/pull/318>`__, commits `d1ad3b
<https://github.com/wjakob/nanobind/commit/d1ad3b91346a1566f42fdf194a3ed9c3eeec5858>`__
and `5f25ae
<https://github.com/wjakob/nanobind/commit/5f25ae0eb9691fbe03a20bcb9f604277ccc1884b>`__).
* The STL sequence casters (``std::vector<T>``, etc.) now refuse to unpack
``str`` and ``bytes`` objects analogous to pybind11. (commit `7e4a88
<https://github.com/wjakob/nanobind/commit/7e4a88b7ccc047ce34ae8ae99492d46b1acf341a>`__).