def __init__(self, fn, name=None):

    @functools.wraps(fn)
    def _fn(*args, **kwargs):
        return fn(*args, **kwargs)
    self.fn = _fn
    if name:
        self.fn.__name__ = name
def __init__(self, fn, name=None):

    @functools.wraps(fn)
    def _fn(*args, **kwargs):
        return fn(*args, **kwargs)
    self.fn = _fn
    if name:
        self.fn.__name__ = name