MCPcopy Create free account
hub / github.com/PyO3/pyo3 / PyCFunction_GET_CLASS

Function PyCFunction_GET_CLASS

pyo3-ffi/src/cpython/methodobject.rs:59–69  ·  view source on GitHub ↗
(func: *mut PyObject)

Source from the content-addressed store, hash-verified

57#[cfg(not(GraalPy))]
58#[inline]
59pub unsafe fn PyCFunction_GET_CLASS(func: *mut PyObject) -> *mut PyTypeObject {
60 debug_assert_eq!(PyCMethod_Check(func), 1);
61
62 let func = func.cast::<PyCFunctionObject>();
63 if (*(*func).m_ml).ml_flags & METH_METHOD != 0 {
64 let func = func.cast::<PyCMethodObject>();
65 (*func).mm_class
66 } else {
67 core::ptr::null_mut()
68 }
69}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected