# libtmux._internal.sparse_array.SparseArray.as_list

- **Module:** libtmux._internal.sparse_array.SparseArray
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/_internal/sparse_array.py#L173
- **Page:** https://libtmux.org/reference/py/libtmux-_internal-sparse_array-sparsearray-as_list/

```
libtmux._internal.sparse_array.SparseArray.as_list(self) -> list[T]
```

Return values as a list in sorted index order.

## Returns

list[T]
    List of values sorted by their indices.

## Example

```python
>>> from libtmux._internal.sparse_array import SparseArray
```

## Example

```python
>>> arr: SparseArray[str] = SparseArray()
>>> arr.add(10, "tenth")
>>> arr.add(0, "zeroth")
>>> arr.add(5, "fifth")
>>> arr.as_list()
['zeroth', 'fifth', 'tenth']
```
