+ 1

Can anyone explain me decorators in easiest way

4th Sep 2022, 5:43 AM
SAIF ALI
SAIF ALI - 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
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠœŠ¾Š»Š“Š¾Š²Š°Š½Š¾Š²
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠœŠ¾Š»Š“Š¾Š²Š°Š½Š¾Š² - avatar
+ 2
It's better to read on "habr"
4th Sep 2022, 6:48 AM
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠœŠ¾Š»Š“Š¾Š²Š°Š½Š¾Š²
Š•Š²Š³ŠµŠ½ŠøŠ¹ ŠœŠ¾Š»Š“Š¾Š²Š°Š½Š¾Š² - avatar