question 326 Decorators & Context Managers · medium
The command table that lists only wrapper
A maintenance tool builds its command list from functions: the command name is the function's __name__, the help text its docstring. Since every command was wrapped with audited, the list shows a single command called wrapper with no help, and export(path=..., fmt=...) crashes with a TypeError. Fix the decorator.
Decorator
audited(func) appends the command's name to audit_log and then runs itcommands()returns
{name: help} for the registered commandsMustkeep each command's name and docstring, pass keyword arguments, and log the real name