aioplus.amin

async aioplus.amin(aiterable, /, *, key=None, default=Ellipsis)

Return the smallest item in aiterable.

Parameters:
  • aiterable (AsyncIterable[T]) – Iterable.

  • key (Callable[[T], SupportsRichComparison], optional) – Comparator.

  • default (D, unset) – Default.

Returns:

Item.

Return type:

T | D

Notes

  • If aiterable is empty and default is unset, then ValueError is raised.

Examples

>>> aiterable = arange(23)
>>> await amin(aiterable)
0

See also

min()