Core LibrarystableAPI Reference

Choose documentation 3

stable

Current version

stable
English

Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

method libtmux stable

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 preview Open reference