Handbook
Glossary
unsteal-ref ( ref -- )
Vocabulary
python
.
errors
Inputs
ref
a python object
Outputs
None
Word description
Unsteals a reference. Used by wrappers that call Python functions that steal references. Functions such as
PyTuple_SetItem
takes ownership of the references passed in and relieves Factor of its burden to decrement them.
Definition
USING:
accessors
alien
combinators.short-circuit
destructors.private
kernel
namespaces
python.ffi
sequences
;
IN:
python.errors
:
unsteal-ref
( ref -- )
always-destructors
get
[
{
[
nip
Py_DecRef-destructor?
]
[
alien>>
[
alien-address
]
bi@
=
]
}
2&&
not
]
with
filter!
drop
;