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

Method copy

crates/vm/src/stdlib/_collections.rs:99–106  ·  view source on GitHub ↗
(zelf: PyRef<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

97 #[pymethod(name = "__copy__")]
98 #[pymethod]
99 fn copy(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
100 Self {
101 deque: PyRwLock::new(zelf.borrow_deque().clone()),
102 maxlen: zelf.maxlen,
103 state: AtomicCell::new(zelf.state.load()),
104 }
105 .into_ref_with_type(vm, zelf.class().to_owned())
106 }
107
108 #[pymethod]
109 fn count(&self, obj: PyObjectRef, vm: &VirtualMachine) -> PyResult<usize> {

Callers

nothing calls this directly

Calls 7

newFunction · 0.85
into_ref_with_typeMethod · 0.80
borrow_dequeMethod · 0.80
cloneMethod · 0.45
loadMethod · 0.45
to_ownedMethod · 0.45
classMethod · 0.45

Tested by

no test coverage detected