Python Decorators - Multiple Decorators and Optional Args

preview_player
Показать описание
Learn how to optionally pass arguments to a decorator and how to apply multiple decorators to your functions.
Рекомендации по теме
Комментарии
Автор

I normally don't post comments on YouTube, but this time I'd like to say HUUUGE thanks to the author of this video for providing a brilliant explanation of how decorators with optional arguments work in Python.
I've been struggling to 'wrap' my head around them (pun not intended :)), even asked ChatGPT to help me out😅 but I just couldn't get a clear picture of why we needed that if-else statement inside of the decorator, and how the hell that decorated function would appear in the decorator's signature as _fnc parameter. Now it seems to be sinking in with ease.
Great video, thanks!

nerdbygod