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

Method new

crates/vm/src/object/core.rs:310–318  ·  view source on GitHub ↗
(dict: Option<PyDictRef>, member_count: usize)

Source from the content-addressed store, hash-verified

308
309impl ObjExt {
310 fn new(dict: Option<PyDictRef>, member_count: usize) -> Self {
311 Self {
312 dict: dict.map(InstanceDict::new),
313 slots: core::iter::repeat_with(|| PyRwLock::new(None))
314 .take(member_count)
315 .collect_vec()
316 .into_boxed_slice(),
317 }
318 }
319}
320
321impl fmt::Debug for ObjExt {

Callers

nothing calls this directly

Calls 9

newFunction · 0.85
has_featureMethod · 0.80
SomeClass · 0.50
mapMethod · 0.45
takeMethod · 0.45
unwrapMethod · 0.45
extendMethod · 0.45
addMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected