+ 4
What are the features of decorators?
Decorators are very useful, of course. But what opportunities can they give? I really want to hear ideas and examples of using this type of function because it is so interesting! Maybe just simple cases - all thoughts are great, I think.
4 Respostas
+ 9
I had the same doubt. I mean, I understand them and all, but what the heck are they used for?
This little article cleared everything for me:
https://www.thecodeship.com/patterns/guide-to-JUMP_LINK__&&__python__&&__JUMP_LINK-function-decorators/
+ 5
Also, I gave an example piece of code here, hope you find it useful:
https://www.sololearn.com/Discuss/197871/?ref=app
+ 2
Here is an example of what a decorator may be useful for:
https://code.sololearn.com/cD09ijlIS6Ev/?ref=app
+ 1
@Kuba Siekierzyński , thank you! These links are very useful:) Especially the article - it really makes everything clear.