jina.types.list module

class jina.types.list.ListView(list)[source]

Bases: jina.types.mixin.ProtoTypeMixin, collections.abc.MutableSequence

Create a Python mutable sequence view of Protobuf ListValue struct.

This can be used in all Jina types where a protobuf.ListValue is returned.

Used inside StructView when the inner element is a ListValue

Create a Python list view of Protobuf ListValue.

Parameters

list (ListValue) – the protobuf ListValue object

insert(index, object)[source]

Insert any value that can be converted into a struct_pb2.Value into the list

Parameters
  • index (int) – Position of the insertion.

  • object (Any) – The object that needs to be inserted.

Return type

None

clear()[source]

# noqa: DAR101 # noqa: DAR102 # noqa: DAR103