def rank(items, item, max_rank=None):
    """Find the rank of 'item' in the list 'items',
    returning None if the item is missing, where the first element is
    considered rank=1.

    `items` -- `list` -- to search through

    `item` -- `any` -- target

    `max_rank` -- `int` or `None` -- stop the search early at this rank;
                  if not found, return `None`

    `return` -- `int` or `None` -- `rank >= 1`, or `None` if the item was
                not found
    """
    try:
        stop = max_rank if max_rank is not None else len(items)
        return 1 + items.index(item, 0, stop)
    except ValueError:
        return None
