from typing import Union


def decrement_by_n(n: Union[int, float]):
    """Generates a function that
    will decrement by n.

    Args:
        n (int): integer to decrement
        by.

    >>> decrement_by_n(2)(2)
    0
    """

    def decrementor(base: Union[int, float]):
        return base - n

    return decrementor