avl._core.list module

class avl._core.list.List(*args: list[Any])[source]
__init__(*args: list[Any]) None[source]

Initializes the List.

Parameters:

args (list[Any]) – Initial elements of the list.

append(data: Any) None[source]

Appends an element to the list and sets the event.

Parameters:

data (Any) – The element to be appended.

clear() None[source]

Clears the list and clears the event.

extend(iterable: list[Any]) None[source]

Extends the list with elements from an iterable and sets the event.

Parameters:

iterable (list[Any]) – The iterable to extend the list with.

insert(index: int, data: Any) None[source]

Inserts an element at a given position in the list and sets the event.

Parameters:
  • index (int) – Position at which to insert the element.

  • data (Any) – The element to be inserted.

pop(index: int = -1) Any[source]

Pops an element from the list at a given position.

Parameters:

index (int) – Position from which to pop the element. Defaults to -1 (last element).

Returns:

The popped element.

Return type:

Any

remove(data: Any) None[source]

Removes the first occurrence of an element from the list and sets the event.

Parameters:

data (Any) – The element to be removed.

async blocking_pop() Any[source]

Pops an element from the list, blocking if the list is empty.

Returns:

The popped element.

Return type:

Any

async blocking_get() Any[source]

Gets an element from the list, blocking if the list is empty.

Returns:

The retrieved element.

Return type:

Any