What about this version for the decorator example ? | Sololearn: Learn to code for FREE!
+ 1

What about this version for the decorator example ?

def wrap(func,ex=True): if ex: print("============") func() print("============") else: pass return wrap def print_text(): print("Hello world!") decorated = wrap(print_text,False) decorated(print_text) ========= original version ========== def decor(func): def wrap(): print("============") func() print("============") return wrap def print_text(): print("Hello world!") decorated = decor(print_text) decorated()

26th Mar 2017, 12:48 PM
Jean-Pierre Schnyder
Jean-Pierre Schnyder - avatar
1 Answer
+ 8
Well, you can submit that change request to SoloLearn by email to info@sololearn.com, in the app by feedback function, on Facebook or Twitter.
8th Apr 2017, 6:57 PM
Tashi N
Tashi N - avatar