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

Function vars

crates/vm/src/stdlib/builtins.rs:1155–1162  ·  view source on GitHub ↗
(obj: OptionalArg, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1153
1154 #[pyfunction]
1155 fn vars(obj: OptionalArg, vm: &VirtualMachine) -> PyResult {
1156 if let OptionalArg::Present(obj) = obj {
1157 obj.get_attr(identifier!(vm, __dict__), vm)
1158 .map_err(|_| vm.new_type_error("vars() argument must have __dict__ attribute"))
1159 } else {
1160 Ok(vm.current_locals()?.into())
1161 }
1162 }
1163
1164 #[pyfunction]
1165 pub fn __build_class__(

Callers 15

sre_compile.pyFile · 0.85
findsourceFunction · 0.85
_expand_helpMethod · 0.85
__call__Method · 0.85
__eq__Method · 0.85
sre_parse.pyFile · 0.85
get_type_hintsFunction · 0.85
evaluateMethod · 0.85
get_annotationsFunction · 0.85
sre_constants.pyFile · 0.85
__repr__Method · 0.85
read_moduleMethod · 0.85

Calls 2

current_localsMethod · 0.80
get_attrMethod · 0.45

Tested by 15

run_perfMethod · 0.68
__eq__Method · 0.68
stderr_to_parser_errorFunction · 0.68
test_reprMethod · 0.68
test_subclassesMethod · 0.68
get_vars_f0Method · 0.68
get_vars_f2Method · 0.68
test_varsMethod · 0.68
test_slotsMethod · 0.68