0
Can anybody kindly explain python decorators? I'm completely lost 😢
2 Réponses
+ 6
It's a big concept and cannot not be explained easily.
Try the 'Python Intermediate' course, In decorator chapter there are many good comments explaining the concept + resources that might help you.
+ 2
"Decorator" or "Wrapper" is a very old design pattern that has evolved from the heroic ages of object-oriented programming.
https://refactoring.guru/design-patterns/decorator
Essentially it is a way to add new functionality to an existing object or modify its behavior, without actually changing the original.
The decorators in Python implement this pattern in a quite unique manner, by functional closures.