def rename(name):

    def _decorator(fn):

        def renamed(*args, **kwargs):
            return fn(*args, **kwargs)
renamed.__name__ = name
return renamed
return _decorator

@rename('I like omelettes in the morning.')
def foo():
    return 'bar'
foo()
foo.__name__
Декоратор Python с опциями