runtime
326 / 500
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.

Decoratoraudited(func) appends the command's name to audit_log and then runs it
commands()returns {name: help} for the registered commands
Mustkeep each command's name and docstring, pass keyword arguments, and log the real name

Loading your progress…

The command table that lists only wrapper — Python practice · Runtime