In a three-level decorator factory `repeat(n)` that wraps a function, on which level must `@functools.wraps(fn)` be applied to preserve the original function's __name__ and __doc__?
import functools
def repeat(n):
def deco(fn):
def wrapper(*a, **k):
for _ in range(n):
r = fn(*a, **k)
return r
return wrapper
return deco