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

Method from_data

crates/vm/src/types/structseq.rs:196–203  ·  view source on GitHub ↗

Convert a Data struct into a PyStructSequence instance.

(data: Self::Data, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

194
195 /// Convert a Data struct into a PyStructSequence instance.
196 fn from_data(data: Self::Data, vm: &VirtualMachine) -> PyTupleRef {
197 let tuple =
198 <Self::Data as ::rustpython_vm::types::PyStructSequenceData>::into_tuple(data, vm);
199 let typ = Self::static_type();
200 tuple
201 .into_ref_with_type(vm, typ.to_owned())
202 .expect("Every PyStructSequence must be a valid tuple. This is a RustPython bug.")
203 }
204
205 #[pyslot]
206 fn slot_repr(zelf: &PyObject, vm: &VirtualMachine) -> PyResult<PyStrRef> {

Callers

nothing calls this directly

Calls 2

into_ref_with_typeMethod · 0.80
to_ownedMethod · 0.45

Tested by

no test coverage detected