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

Method to_bound_method

crates/vm/src/function/method.rs:138–152  ·  view source on GitHub ↗
(
        &'static self,
        obj: PyObjectRef,
        class: &'static Py<PyType>,
    )

Source from the content-addressed store, hash-verified

136 }
137
138 pub const fn to_bound_method(
139 &'static self,
140 obj: PyObjectRef,
141 class: &'static Py<PyType>,
142 ) -> PyNativeMethod {
143 PyNativeMethod {
144 func: PyNativeFunction {
145 zelf: Some(obj),
146 value: self,
147 module: None,
148 _method_def_owner: None,
149 },
150 class,
151 }
152 }
153
154 pub fn build_function(&'static self, ctx: &Context) -> PyRef<PyNativeFunction> {
155 self.to_function().into_ref(ctx)

Callers 1

build_bound_methodMethod · 0.80

Calls 1

SomeClass · 0.50

Tested by

no test coverage detected