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

Method __sizeof__

crates/vm/src/builtins/str.rs:678–680  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

676
677 #[pymethod]
678 fn __sizeof__(&self) -> usize {
679 core::mem::size_of::<Self>() + self.byte_len() * core::mem::size_of::<u8>()
680 }
681
682 fn __mul__(zelf: PyRef<Self>, value: ArgSize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
683 Self::repeat(zelf, value.into(), vm)

Callers

nothing calls this directly

Calls 1

byte_lenMethod · 0.45

Tested by

no test coverage detected