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

Method ast_from_object

crates/vm/src/stdlib/_ast/basic.rs:11–18  ·  view source on GitHub ↗
(
        vm: &VirtualMachine,
        _source_file: &SourceFile,
        object: PyObjectRef,
    )

Source from the content-addressed store, hash-verified

9 }
10
11 fn ast_from_object(
12 vm: &VirtualMachine,
13 _source_file: &SourceFile,
14 object: PyObjectRef,
15 ) -> PyResult<Self> {
16 let py_str = PyUtf8StrRef::try_from_object(vm, object)?;
17 Ok(Self::new(py_str.as_str(), TextRange::default()))
18 }
19}
20
21impl Node for ast::Int {

Callers

nothing calls this directly

Calls 8

newFunction · 0.85
try_into_valueMethod · 0.80
to_stringMethod · 0.80
as_bigintMethod · 0.80
as_strMethod · 0.45
unwrapMethod · 0.45
parseMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected