from typing import Iterable
from typing import Any


def argsort_iterable(x: Iterable[Any]) -> Iterable[int]:
    """Iterable of indexes that sort an array.

    This is equivalent to numpy argsort but works on any sortable python iterable
    and returns a python iterable.

    Evaluation is lazy, evaluating x only as needed for sorting.

    Args:
        x (Iterable[Any]): The array to be sorted; must be sortable

    Returns:
        Iterable[int]: The indexes that sort x
    """
    return (i for _,i in sorted((xi,i) for i,xi in enumerate(x)))