from typing import Iterable
from typing import Any
from typing import Iterator
from typing import Tuple
import itertools


def pairwise(iterable: Iterable[Any]) -> Iterator[Tuple[Any, Any]]:
    """Return iterator of overlapping pairs of items from an iterable.

    Will return an empty iterable if the passed iterable does not have
    at least two items.

    Will not return if passed an infinite iterator.

    Arguments:
        iterable: object to be iterated over pairwise

    Returns:
        iterator of tuples of pairs of sequential items from iterable

    Examples:

    >>> list(pairwise(range(8)))
    [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7)]
    >>> list(pairwise(range(1)))
    []
    >>> list(pairwise(()))
    []

    """
    first, second = itertools.tee(iterable)
    next(second, None)
    return zip(first, second)