Skip to content

Lists

Contains blocks to interact with lists.

append(*, item, list)

Add item to the end of the list.

Parameters:

Name Type Description Default
item Any

The item that will be added to list.

required
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

clear(*, list)

Remove all items from list.

Parameters:

Name Type Description Default
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

copy(*, list)

Return a shallow copy of the list.

Parameters:

Name Type Description Default
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

count(*, list)

Counts the elements in a list.

Parameters:

Name Type Description Default
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

count_item(*, item, list)

Return number of occurrences of value.

Parameters:

Name Type Description Default
item Any

The item that will be counted.

required
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

create(*, value1=Empty, value2=Empty)

Creates a new list with items. If items are not provided, then returns an empty list.

Parameters:

Name Type Description Default
value1 Any

A value that will be added to list.

Empty
value2 Any

A value that will be added to list.

Empty

extend(*, list1, list2)

Extend list by appending elements from the list2. list2 will not be modified but list1 will be.

Parameters:

Name Type Description Default
list1 Union[List[Any], pyconduit.step.ConduitVariable]

First list.

required
list2 Union[List[Any], pyconduit.step.ConduitVariable]

Second list.

required

flatten(*, values)

Moves the inner lists' items to the root of the list. Only one depth is supported.

Parameters:

Name Type Description Default
values Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

get(*, list, index)

Return the item in the position.

Parameters:

Name Type Description Default
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required
index int

The index of item.

required

includes(*, item, list)

Checks if item in the list.

Added in v1.1

Parameters:

Name Type Description Default
item Any

The item that will be checked.

required
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

includes_all(*, items, list)

Checks if all of the items in the list.

Added in v1.1

Parameters:

Name Type Description Default
items Union[List[Any], pyconduit.step.ConduitVariable]

A list of items that will be checked.

required
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

includes_any(*, items, list)

Checks if one of the items in the list.

Added in v1.1

Parameters:

Name Type Description Default
items Union[List[Any], pyconduit.step.ConduitVariable]

A list of items that will be checked.

required
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

index(*, list, item)

Return the index of the item. Returns -1 if item is not found.

Parameters:

Name Type Description Default
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required
item Any

The item that its index will be returned.

required

insert(*, list, index, item)

Insert object before index.

Parameters:

Name Type Description Default
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required
index int

The index that will item placed in.

required
item Any

The item that will be added to list.

required

merge(*, list1, list2)

Merge the two lists.

Parameters:

Name Type Description Default
list1 Union[List[Any], pyconduit.step.ConduitVariable]

First list.

required
list2 Union[List[Any], pyconduit.step.ConduitVariable]

Second list.

required

pop(*, list, index=None)

Remove and return item at index (default last).

Parameters:

Name Type Description Default
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required
index Optional[int]

The index of item that will be removed.

None

random(*, list)

Gets a random item from the list.

Warning

Standard pseudo-random generators are not suitable for security/cryptographic purposes.

Added in v1.1

Parameters:

Name Type Description Default
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

remove(*, item, list)

Remove a item from list.

Parameters:

Name Type Description Default
item Any

The item that will be removed.

required
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

reverse(*, list)

Reverses the list in place.

Parameters:

Name Type Description Default
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required

sort(*, list, reverse=False)

Sort list in place.

Parameters:

Name Type Description Default
list Union[List[Any], pyconduit.step.ConduitVariable]

The list that will be used in the operation.

required
reverse bool

If True, the sorted list is reversed (or sorted in Descending order)

False