(
dict: PyDictRef,
key: PyObjectRef,
vm: &VirtualMachine,
)
| 49 | |
| 50 | #[pyfunction] |
| 51 | fn _remove_dead_weakref( |
| 52 | dict: PyDictRef, |
| 53 | key: PyObjectRef, |
| 54 | vm: &VirtualMachine, |
| 55 | ) -> PyResult<()> { |
| 56 | dict._as_dict_inner() |
| 57 | .delete_if(vm, &*key, |wr| { |
| 58 | let wr = wr |
| 59 | .downcast_ref::<PyWeak>() |
| 60 | .ok_or_else(|| vm.new_type_error("not a weakref"))?; |
| 61 | Ok(wr.is_dead()) |
| 62 | }) |
| 63 | .map(drop) |
| 64 | } |
| 65 | } |
nothing calls this directly
no test coverage detected