From b490b44e34f57433e562a2f8f7de6202f30a017a Mon Sep 17 00:00:00 2001 From: Bruce Merry Date: Fri, 1 Sep 2017 09:27:00 +0200 Subject: [PATCH] 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. --- docs/advanced/functions.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/advanced/functions.rst b/docs/advanced/functions.rst index 0e2b16c34..cdf318c0f 100644 --- a/docs/advanced/functions.rst +++ b/docs/advanced/functions.rst @@ -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