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:
Bruce Merry 2017-09-01 09:27:00 +02:00 committed by Dean Moldovan
parent 2fb4e9532e
commit b490b44e34

View File

@ -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`` index ``2``. Arbitrarily many call policies can be specified. When a ``Nurse``
with value ``None`` is detected at runtime, the call policy does nothing. 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 When the nurse is not a pybind11-registered type, the implementation internally
the nurse object, which is permitted by all classes exposed via pybind11. When relies on the ability to create a *weak reference* to the nurse object. When
the nurse object does not support weak references, an exception will be thrown. 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 Consider the following example: here, the binding code for a list append
operation ties the lifetime of the newly added element to the underlying operation ties the lifetime of the newly added element to the underlying