Function pyo3::gil::register_incref

source ·
pub unsafe fn register_incref(obj: NonNull<PyObject>)
Available on crate feature py-clone only.
Expand description

Increments the reference count of a Python object if the GIL is held. If the GIL is not held, this function will panic.

§Safety

The object must be an owned Python reference.

⚠️ Internal Docs ⚠️ Not Public API 👉 Official Docs Here