Skip to content

Commit b490b44

Browse files
bmerrydean0x7d
authored andcommitted
Update documentation for keep_alive to match new implementation
PR #880 changed the implementation of keep_alive to avoid weak references when the nurse is pybind11-registered, but the documentation didn't get updated to match.
1 parent 2fb4e95 commit b490b44

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/advanced/functions.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,10 @@ indices start at one, while zero refers to the return value. For methods, index
177177
index ``2``. Arbitrarily many call policies can be specified. When a ``Nurse``
178178
with value ``None`` is detected at runtime, the call policy does nothing.
179179

180-
This feature internally relies on the ability to create a *weak reference* to
181-
the nurse object, which is permitted by all classes exposed via pybind11. When
182-
the nurse object does not support weak references, an exception will be thrown.
180+
When the nurse is not a pybind11-registered type, the implementation internally
181+
relies on the ability to create a *weak reference* to the nurse object. When
182+
the nurse object is not a pybind11-registered type and does not support weak
183+
references, an exception will be thrown.
183184

184185
Consider the following example: here, the binding code for a list append
185186
operation ties the lifetime of the newly added element to the underlying

0 commit comments

Comments
 (0)