+ 2

How do decorators work in Python? Please could anyone explain with a simple example

19th Aug 2017, 7:28 PM
Jerlyn
3 Respostas
+ 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.
19th Aug 2017, 7:38 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
Here is an example of what a decorator may be useful for: https://code.sololearn.com/cD09ijlIS6Ev/?ref=app
25th Mar 2018, 4:33 PM
Denys Yeromenko
Denys Yeromenko - avatar
0
thank u
19th Aug 2017, 7:44 PM
Jerlyn