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

Function _reset_registry

crates/vm/src/stdlib/_abc.rs:451–459  ·  view source on GitHub ↗
(cls: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

449 /// Internal ABC helper to reset registry of a given class.
450 #[pyfunction]
451 fn _reset_registry(cls: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {
452 let impl_data = get_impl(&cls, vm)?;
453 // Clone set ref and drop lock before calling into VM to avoid reentrancy
454 let set = impl_data.registry.read().clone();
455 if let Some(ref set) = set {
456 vm.call_method(set.as_ref(), "clear", ())?;
457 }
458 Ok(())
459 }
460
461 /// Internal ABC helper to reset both caches of a given class.
462 #[pyfunction]

Callers 1

_abc_registry_clearMethod · 0.90

Calls 5

get_implFunction · 0.85
cloneMethod · 0.45
readMethod · 0.45
call_methodMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected