+ 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()
1 ответ
+ 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.