from typing import Callable


def extension_matcher(extension: str) -> Callable[[str], bool]:
    """
    Returns a closure that checks if a filename has a certain extension.
    """
    def has_extension(filename: str) -> bool:
        return filename.endswith("." + extension)
    return has_extension