Skip to main content

struct_sequence_new

Function struct_sequence_new 

Source
pub fn struct_sequence_new(
    cls: PyTypeRef,
    args: StructSequenceNewArgs,
    hidden_field_names: &[&str],
    vm: &VirtualMachine,
) -> PyResult
Expand description

Create a new struct sequence instance from a sequence.

dict supplies the hidden fields — the ones past n_sequence_fields, named by hidden_field_names in order — that the sequence itself did not cover. It may not name a field the sequence already supplied, nor one that does not exist.

The class must have n_sequence_fields and n_fields attributes set (done automatically by PyStructSequence::extend_pyclass).