from pathlib import Path


def dir_files(path, pattern="*"):
    """
    Returns all files in a directory
    """
    if not isinstance(path, Path):
        raise TypeError("path must be an instance of pathlib.Path")

    return [f for f in path.glob(pattern) if f.is_file()]