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

Method __annotate__

crates/vm/src/builtins/module.rs:311–322  ·  view source on GitHub ↗
(zelf: &Py<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

309
310 #[pygetset]
311 fn __annotate__(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyObjectRef> {
312 let dict = zelf.dict();
313 // Get __annotate__ from dict; if not present, insert None and return it
314 // See: module_get_annotate()
315 if let Some(annotate) = dict.get_item_opt(identifier!(vm, __annotate__), vm)? {
316 Ok(annotate)
317 } else {
318 let none = vm.ctx.none();
319 dict.set_item(identifier!(vm, __annotate__), none.clone(), vm)?;
320 Ok(none)
321 }
322 }
323
324 #[pygetset(setter)]
325 fn set___annotate__(

Callers

nothing calls this directly

Calls 5

get_item_optMethod · 0.80
noneMethod · 0.80
dictMethod · 0.45
set_itemMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected