4.5. Decorator About Arguments

  • Without Arguments

  • With Positional Arguments

  • With Mixed Arguments

  • With Keyword Arguments

4.5.1. Without Arguments

>>> @mydecorator  
... def myfunction(*args, **kwargs):
...     ...

4.5.2. With Positional Arguments

>>> @mydecorator('Mark', 'Watney')  
... def myfunction(*args, **kwargs):
...     ...

4.5.3. With Mixed Arguments

>>> @mydecorator('Mark', lastname='Watney')  
... def myfunction(*args, **kwargs):
...     ...

4.5.4. With Keyword Arguments

>>> @mydecorator(firstname='Mark', lastname='Watney')  
... def myfunction(*args, **kwargs):
...     ...