+ 3

Anyone please send me link of best and simple Python decoration explanation

30th Sep 2017, 5:34 PM
Ruzan
Ruzan - avatar
3 Answers
+ 9
I once wrote a simple, example code with two decorators. Basically, decorators modify the normal execution of a method and alter its behavior, by using it as an argument in another method. Check it out: https://code.sololearn.com/cn8ZQJ689rWX/?ref=app
30th Sep 2017, 5:44 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
def decor(func): def wrap(): print("============") func() print("============") return wrap @decor def print_text(): print("Hello I'm Rishita..!") print_text();
30th Sep 2017, 5:46 PM
Rishita
Rishita - avatar
0
Decorators is a way to modify functions using other functions.
1st Oct 2017, 10:50 AM
Rishita
Rishita - avatar