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

Function register

crates/vm/src/stdlib/atexit.rs:9–16  ·  view source on GitHub ↗
(func: PyObjectRef, args: FuncArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

7
8 #[pyfunction]
9 fn register(func: PyObjectRef, args: FuncArgs, vm: &VirtualMachine) -> PyObjectRef {
10 // Callbacks go in LIFO order (insert at front)
11 vm.state
12 .atexit_funcs
13 .lock()
14 .insert(0, Box::new((func.clone(), args)));
15 func
16 }
17
18 #[pyfunction]
19 fn _clear(vm: &VirtualMachine) {

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
insertMethod · 0.45
lockMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected