mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-21 20:55:11 +00:00
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.
This commit is contained in:
parent
2fb4e9532e
commit
b490b44e34
@ -177,9 +177,10 @@ indices start at one, while zero refers to the return value. For methods, index
|
||||
index ``2``. Arbitrarily many call policies can be specified. When a ``Nurse``
|
||||
with value ``None`` is detected at runtime, the call policy does nothing.
|
||||
|
||||
This feature internally relies on the ability to create a *weak reference* to
|
||||
the nurse object, which is permitted by all classes exposed via pybind11. When
|
||||
the nurse object does not support weak references, an exception will be thrown.
|
||||
When the nurse is not a pybind11-registered type, the implementation internally
|
||||
relies on the ability to create a *weak reference* to the nurse object. When
|
||||
the nurse object is not a pybind11-registered type and does not support weak
|
||||
references, an exception will be thrown.
|
||||
|
||||
Consider the following example: here, the binding code for a list append
|
||||
operation ties the lifetime of the newly added element to the underlying
|
||||
|
Loading…
Reference in New Issue
Block a user