from typing import Union
from pathlib import Path


def make_path(
        in_folder: Union[str, Path], *subnames: str, pth_obj: bool = False
) -> Union[str, Path]:
    """Dynamically set a path (e.g., for iteratively referencing
        year-specific geodatabases)
    Args:
        in_folder (str): String or Path
        subnames (list/tuple): A list of arguments to join in making the full path
            `{in_folder}/{subname_1}/.../{subname_n}
    Returns:
        Path
    """
    pth = Path(in_folder, *subnames)
    if pth_obj:
        return pth
    else:
        return str(pth)