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

Function getweakrefs

crates/vm/src/stdlib/_weakref.rs:43–48  ·  view source on GitHub ↗
(obj: PyObjectRef)

Source from the content-addressed store, hash-verified

41
42 #[pyfunction]
43 fn getweakrefs(obj: PyObjectRef) -> Vec<PyObjectRef> {
44 match obj.get_weak_references() {
45 Some(v) => v.into_iter().map(Into::into).collect(),
46 None => vec![],
47 }
48 }
49
50 #[pyfunction]
51 fn _remove_dead_weakref(

Callers

nothing calls this directly

Calls 4

get_weak_referencesMethod · 0.80
collectMethod · 0.80
mapMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected