def max_i(it):
    """Find the maximum entry of an iterable, and return it with its index.

    Returns (i, m) where i is the index of m, the maximum entry of `it`.
    """
    idx, m = None, None
    for i, val in enumerate(it):
        if m is None or val > m:
            m, idx = val, i
    return idx, m