Python example: decorators

Python decorators example

Defines a decorator that wraps another function, logs the function name plus arguments, and then calls the original function. It uses functools.wraps() to preserve metadata and shows applying a decorator with @my_decorator.

Result

Console output