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

Method register

crates/vm/src/codecs.rs:209–215  ·  view source on GitHub ↗
(&self, search_function: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

207 }
208
209 pub fn register(&self, search_function: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
210 if !search_function.is_callable() {
211 return Err(vm.new_type_error("argument must be callable"));
212 }
213 self.inner.write().search_path.push(search_function);
214 Ok(())
215 }
216
217 pub fn unregister(&self, search_function: PyObjectRef) -> PyResult<()> {
218 let mut inner = self.inner.write();

Callers 1

registerFunction · 0.45

Calls 4

is_callableMethod · 0.80
ErrClass · 0.50
pushMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected