i ve some confusion with decorators | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

i ve some confusion with decorators

guys i m not able to understand why we define a wrapper function inside decorator function...cant we write the code in wrapper function directly in created decorator function

18th Feb 2020, 7:35 AM
PRO
PRO - avatar
1 Answer
0
The pattern/decorator can be used at any time, to wrap any function.
18th Feb 2020, 8:33 AM
Mihai Apostol
Mihai Apostol - avatar