aioplus.alast¶
- async aioplus.alast(aiterable, /, *, default=Sentinel.UNSET)¶
Return the last item of the
aiterable.- Parameters:
aiterable (AsyncIterable[T]) – An asynchronous iterable to retrieve the item from.
default (D, optional) – A default value to return if the iterable is empty. If not provided,
IndexErrorwill be raised if the iterable is empty.
- Returns:
The last item of
aiterableor the default value.- Return type:
T or D
Examples
>>> aiterable = arange(23) >>> await alast(aiterable) 22