Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux latest

SparseArray.as_list

Return values as a list in sorted index order.

Source and package
Qualified name
libtmux._internal.sparse_array.SparseArray.as_list
Module
libtmux._internal.sparse_array
Declared in
SparseArray
Package
libtmux
Source
src/libtmux/_internal/sparse_array.py
as_list (self) → list[T]

Examples#

>>> from libtmux._internal.sparse_array import SparseArray
>>> arr: SparseArray[str] = SparseArray()
>>> arr.add(10, "tenth")
>>> arr.add(0, "zeroth")
>>> arr.add(5, "fifth")
>>> arr.as_list()
['zeroth', 'fifth', 'tenth']
Type parameters
Returns

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

Esc

Type to search.

Reference previewOpen reference