mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 06:49:25 +00:00
functions: Add doc on incorrect argument index (#2979)
test_call_policies: Explicitly check free-functions and static methods
This commit is contained in:
@@ -182,6 +182,9 @@ 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.
|
||||
|
||||
If you use an incorrect argument index, you will get a ``RuntimeError`` saying
|
||||
``Could not activate keep_alive!``. You should review the indices you're using.
|
||||
|
||||
Consider the following example: here, the binding code for a list append
|
||||
operation ties the lifetime of the newly added element to the underlying
|
||||
container:
|
||||
|
||||
Reference in New Issue
Block a user