Decorating functions with parameters - Python Refresher

preview_player
Показать описание
In this episode of Python Refresher, we learn how to write decorators for Python functions that have parameters or take arguments.

When writing decorators, you may have encountered TypeErrors saying your function is "missing 1 required positional argument", or similar. This happens if your decorator calls the function, but doesn't pass the required arguments.

In this video we learn how to fix that, and make sure our decorators can be applied on any function, with or without parameters!

We've got 4 videos that talk about Python decorators. This is the third video.

-- Links --

Рекомендации по теме
Комментарии
Автор

finally a simple but crystal clear tutorial, thank you!!

PiergiovanniDiGirolamo
Автор

I needed this content. But the example is too difficult to understand.
You are using a function with decorator. And the decorator has a decorator inside it. And then we have another functions and then we return the functions

rheumaticharm
visit shbcf.ru