from typing import Union
from pathlib import Path


def pathify(p: Union[str, Path]) -> Path:
    """
    Allow functions to take strings or proper `Path`s

    If the input is a `Path`, it is returned unchanged. If a string, it is changed to a `Path`
    """
    if isinstance(p, Path):
        return p
    else:
        return Path(p)