> ## Documentation Index
> Fetch the complete documentation index at: https://takeprofit.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Package sortedcontainers

Sorted collections library.

***

## Types

### `SortedList`

*type*

List that holds values in sorted order.

**1. Methods**

[Navigate to method\_SortedList\_init](#method_SortedList_init)

**init**

(lst) -> None

Class constructor (initializer for the data type).

**parameters info**

lst

indie.Optional\[list\[float]]

default:
None

List to get values from.

[Navigate to method\_SortedList\_add](#method_SortedList_add)

add

(value) -> None

Adds given value to the list.

**parameters info**

value

float

required

New value that will be put to the list.

[Navigate to method\_SortedList\_remove](#method_SortedList_remove)

remove

(x) -> None

Removes given value from the list.

**parameters info**

x

float

required

Value that will be removed from the list

[Navigate to method\_SortedList\_getitem](#method_SortedList_getitem)

**getitem**

(i) -> float

Returns list element at given index.

**parameters info**

i

int

required

Index of an element in the list.

> [!NOTE]
>
> Method `__getitem__` should never be called directly, instead `list_obj[key]` syntax should be used.

[Navigate to method\_SortedList\_len](#method_SortedList_len)

**len**

() -> int

Returns the length (the number of items) of a list.
\[!NOTE] Method `__len__` should never be called directly, instead `len(list_obj)` syntax should be used.

[Navigate to method\_SortedList\_contains](#method_SortedList_contains)

**contains**

(x) -> bool

Returns `True` if the list contains the given value, otherwise `False`.

**parameters info**

x

float

required

Element to find in the list.

> [!NOTE]
>
> Method `__contains__` should never be called directly, instead `val in lst` syntax should be used.

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.