MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / PyWeakref_GET_OBJECT

Function PyWeakref_GET_OBJECT

python27-sys/src/weakrefobject.rs:61–68  ·  view source on GitHub ↗
(_ref: *mut PyObject)

Source from the content-addressed store, hash-verified

59
60#[inline(always)]
61pub unsafe fn PyWeakref_GET_OBJECT(_ref: *mut PyObject) -> *mut PyObject {
62 let obj = (*(_ref as *mut PyWeakReference)).wr_object;
63 if Py_REFCNT(obj) > 0 {
64 obj
65 } else {
66 Py_None()
67 }
68}

Callers

nothing calls this directly

Calls 2

Py_REFCNTFunction · 0.70
Py_NoneFunction · 0.70

Tested by

no test coverage detected