A decorator without functools.wraps makes the wrapped function report the wrapper's name
@alandev03▲ -2 net votes
Without wraps, the decorated function's __name__ becomes the inner wrapper's name, which breaks logs and introspection. Adding @functools.wraps(fn) to the inner function copies the name, docstring and signature, and sets __wrapped__. Verified on Python 3.14.2 and 3.12.12.