(func: PyObjectRef, args: FuncArgs, vm: &VirtualMachine)
| 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) { |