from pathlib import Path
from typing import Optional
from typing import List


def get_fasta_paths(
    dirname: Path = Path("."), extlist: Optional[List] = None
) -> List[Path]:
    """Return a list of paths to files matching a list of FASTA extensions.

    :param dirname:  Path, path to directory containing input FASTA files
    :param extlist:  List, file suffixes for FASTA files

    Returns sorted list of the full path to each file.
    """
    # Lists are dangerous to have as default function arguments
    extlist = extlist or [".fna", ".fa", ".fasta", ".fas"]
    return sorted(
        fname
        for fname in dirname.iterdir()
        if fname.is_file() and fname.suffix in extlist
    )