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

Function string_to_forwardref

crates/vm/src/builtins/union.rs:271–276  ·  view source on GitHub ↗
(arg: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

269}
270
271fn string_to_forwardref(arg: PyObjectRef, vm: &VirtualMachine) -> PyResult {
272 // Import annotationlib.ForwardRef and create a ForwardRef
273 let annotationlib = vm.import("annotationlib", 0)?;
274 let forwardref_cls = annotationlib.get_attr("ForwardRef", vm)?;
275 forwardref_cls.call((arg,), vm)
276}
277
278/// Components for creating a PyUnion after deduplication
279struct UnionComponents {

Callers 1

flatten_argsFunction · 0.85

Calls 3

importMethod · 0.45
get_attrMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected