Can anyone explain me decorators in easiest way | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can anyone explain me decorators in easiest way

4th Sep 2022, 5:43 AM
Tony Stark
Tony Stark - avatar
3 Answers
+ 2
Decorator fn: Hey give me your function, I make a cooler function from it and give it back to to you. Program: But I can add myself sth. cool! Decorator: but once defined u can do it with every function Program: Hey Decorator okay I call you with @fn before the function I send to to you.
4th Sep 2022, 8:24 AM
Oma Falk
Oma Falk - avatar
+ 2
A decorator is simply a function that modifies a function and can be called via "@"
4th Sep 2022, 6:45 AM
AjaraGuju
AjaraGuju - avatar
+ 2
It's better to read on "habr"
4th Sep 2022, 6:48 AM
AjaraGuju
AjaraGuju - avatar