Handbook
Glossary
check-borrowed-ref ( ref -- ref )
Vocabulary
python
.
errors
Inputs
ref
a python object
Outputs
ref
a python object
Word description
Adds reference counting to the returned python object which is assumed to be a borrowed reference. An error is thrown if the object is f. This word is used to wrap Python functions that return borrowed references.
Definition
USING:
kernel
python.ffi
;
IN:
python.errors
:
check-borrowed-ref
( ref -- ref )
dup
Py_IncRef
&Py_DecRef
(check-ref)
;