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

Method toreadonly

crates/vm/src/builtins/memory.rs:733–738  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

731
732 #[pymethod]
733 fn toreadonly(&self, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
734 self.try_not_released(vm)?;
735 let mut other = self.new_view();
736 other.desc.readonly = true;
737 Ok(other.into_ref(&vm.ctx))
738 }
739
740 #[pymethod]
741 fn hex(

Callers 5

load_readonly_bufferMethod · 0.80
test_toreadonlyMethod · 0.80
verifyMethod · 0.80
__release_buffer__Method · 0.80

Calls 3

try_not_releasedMethod · 0.80
new_viewMethod · 0.80
into_refMethod · 0.45

Tested by 4

test_toreadonlyMethod · 0.64
verifyMethod · 0.64
__release_buffer__Method · 0.64