

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Decorators
incomplete
2: Args and Kwargs
incomplete
3: Args and Kwargs Practice
incomplete
4: Decorators
incomplete
5: Decorators Review
incomplete
6: LRU Cache
incomplete
7: Decorators Practice
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Doc2Doc should be extensible to allow for third-party plugins. These plugins will be configurable.
Complete the configure_plugin_decorator function. It decorates a function that expects keyword arguments, but it should return a wrapper that accepts positional arguments.
The positional arguments passed to the wrapper will be key-value tuples. For example, after configure_backups is decorated, this call:
plugin_config: dict[str, str] = configure_backups(
("path", "~/duplicates"), ("prefix", "duplicate_"), ("extension", ".rtf")
)
should behave like this call to the original function:
plugin_config: dict[str, str] = configure_backups(
path="~/duplicates", prefix="duplicate_", extension=".rtf"
)
And the returned plugin_config should be:
{
"path": "~/duplicates",
"prefix": "duplicate_",
"extension": ".rtf",
}