Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite+ 1
Please explain me decorators in Python
In class subject I didnt understand decorators.Please explain me.
7 Réponses
+ 3
it is a way to add functionality to an existing function without altering the structure of the function
+ 1
No I have already complated decorators but i cant understand
+ 1
Ok what they do
+ 1
Its like inheriting of a class. But instead, its like inheriting a function.
def decor(func): #func param to call the function
print(func()) #Prints the retured value of a function
@decor
def three():
return 3
This might help. I dunno
+ 1
Ty
0
if you go throught the python course here you will be able to your answer. it will take someone of you level about 30 minutes to reach the bit about decorators
0
okay. so what is it exactly you don’t understand?