Skip to content

Commit

Permalink
changelog updates
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed Oct 13, 2023
1 parent 9d4b2e3 commit b09d26d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 10 deletions.
4 changes: 3 additions & 1 deletion docs/api_core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2460,7 +2460,9 @@ Global flags

The function returns ``true`` when nanobind is initialized and ready for
use. It returns ``false`` when the Python interpreter has shut down, causing
the destruction various nanobind-internal data structures.
the destruction various nanobind-internal data structures. Having access to
this liveness status can be useful to avoid operations that are illegal in
the latter context.

Miscellaneous
-------------
Expand Down
58 changes: 52 additions & 6 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,63 @@ below inherit that of the preceding release.
Version 1.7.0 (TBA)
-------------------

* Added :cpp:func:`nb::globals() <globals>`. (PR `#311
<https://github.com/wjakob/nanobind/pull/311>`__).

* Added :cpp:func:`nb::del() <del>` that takes an arbitrary accessor object.
With this new function, the C++ statement
* 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 former behavior seems highly undesirable and bug-prone. (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>`__).

* 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.
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>`__).

* 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>`__).

* 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.


Version 1.6.2 (Oct 3, 2023)
Expand Down
4 changes: 1 addition & 3 deletions tests/test_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,7 @@ def test22_low_level(clean):
del s1
del s2
del s3
import gc
gc.collect()
gc.collect()
collect()
assert s4.value() == 123
del s4
assert_stats(
Expand Down

0 comments on commit b09d26d

Please sign in to comment.