+ 2
How do decorators work in Python? Please could anyone explain with a simple example
3 Respuestas
+ 7
Yesterday I answered a similar, related question with this code:
https://code.sololearn.com/cn8ZQJ689rWX/?ref=app
Basically, decorators act as "wrappers" taking methods as arguments and altering their "normal", non-decorated behaviour.
+ 2
Here is an example of what a decorator may be useful for:
https://code.sololearn.com/cD09ijlIS6Ev/?ref=app
0
thank u