MCPcopy Index your code
hub / github.com/RustPython/RustPython / build_staticmethod

Method build_staticmethod

crates/vm/src/function/method.rs:211–226  ·  view source on GitHub ↗
(
        &'static self,
        ctx: &Context,
        class: &'static Py<PyType>,
    )

Source from the content-addressed store, hash-verified

209 }
210
211 pub fn build_staticmethod(
212 &'static self,
213 ctx: &Context,
214 class: &'static Py<PyType>,
215 ) -> PyRef<PyNativeMethod> {
216 debug_assert!(self.flags.contains(PyMethodFlags::STATIC));
217 // Set zelf to the class (m_self = type for static methods).
218 // Callable::call skips prepending when STATIC flag is set.
219 let func = PyNativeFunction {
220 zelf: Some(class.to_owned().into()),
221 value: self,
222 module: None,
223 _method_def_owner: None,
224 };
225 PyNativeMethod { func, class }.into_ref(ctx)
226 }
227
228 #[doc(hidden)]
229 pub const fn __const_concat_arrays<const SUM_LEN: usize>(

Callers 1

to_proper_methodMethod · 0.80

Calls 3

SomeClass · 0.50
to_ownedMethod · 0.45
into_refMethod · 0.45

Tested by

no test coverage detected