Decorators with Default Values

Learn how to use decorators with varying syntaxes if the decorators have default values.

In the previous lesson's example, we saw a decorator that takes parameters, but those arguments have default values.

Use of parentheses

The way the previous decorators were written will make sure that they work as long as users don't forget the parentheses to make the function call when using the decorator.

For example, if we only wanted the default values, this would work:

Get hands-on with 1200+ tech skills courses.