unitelabs.labware.utils.list
Attributes
- Name
Item
- Type
- Value
= typing.TypeVar('Item')
- Description
- Name
MaybeList
- Type
- Value
= typing.Union[Item, collections.abc.Sequence[Item]]
- Description
- Name
CharSequence
- Type
- Value
= typing.Union[str, bytes, bytearray, memoryview]
- Description
- Name
T
- Type
- Value
= typing.TypeVar('T')
- Description
Functions
get(list_or_item : MaybeList[Item], index : typing.SupportsIndex) -> typing.Union[CharSequence, Item]
Parameters
- Name
index
- Type
- typing.SupportsIndex
- Default
- Description
Response
- Type
- typing.Union[CharSequence, Item]
- Description
expand(list_or_item : MaybeList[Item], count : int) -> collections.abc.Iterable[typing.Union[CharSequence, Item]]
Uses the given sequence or repeats a single value a specified number of times.
Parameters
- Name
count
- Type
- int
- Default
- Description
The number of times the single value should be repeated.
Response
- Type
- collections.abc.Iterable[typing.Union[CharSequence, Item]]
- Description
A list with the specified number of values.