from typing import Union
from pathlib import Path
import pickle


def read_pickle(path: Union[str, Path]) -> object:
    """Load a pickled object into memory.

    This is a simple wrapper around `pickle.load`.

    Parameters
    ----------
    path : `str or Path`
        File path of a pickled object.

    Returns
    -------
    `object`
        The unpickled object.

    """
    with open(path, 'rb') as handle:
        return pickle.load(handle)