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

Method new_function

crates/vm/src/vm/vm_new.rs:79–87  ·  view source on GitHub ↗
(&self, name: &'static str, f: F)

Source from the content-addressed store, hash-verified

77 }
78
79 pub fn new_function<F, FKind>(&self, name: &'static str, f: F) -> PyRef<PyNativeFunction>
80 where
81 F: IntoPyNativeFn<FKind>,
82 {
83 let def = self
84 .ctx
85 .new_method_def(name, f, PyMethodFlags::empty(), None);
86 def.build_function(self)
87 }
88
89 pub fn new_method<F, FKind>(
90 &self,

Callers 3

runFunction · 0.80
as_jsMethod · 0.80
js_to_pyFunction · 0.80

Calls 2

new_method_defMethod · 0.80
build_functionMethod · 0.45

Tested by

no test coverage detected