Peeking into the internals of Python's 'functools.wraps' decorator

from blog Redowan's Reflections, | ↗ original
↗ original
The functools.wraps decorator allows you to keep your function’s identity intact after it’s been wrapped by a decorator. Whenever a function is wrapped by a decorator, identity properties like—function name, docstring, annotations of it get replaced by those of the wrapper function. Consider this example: from __future__ import annotations # In ...