0

How I can to decorate function with parameters? such as print_reverse(x)?

27th Jul 2016, 7:31 PM
Sweemyn
1 Réponse
+ 2
def decor(func): def wrap(txt): print("============") func(txt) print("============") return wrap @decor def print_text(txt): print(txt) print_text("Hello World"); print_text("Goodbye world") print_text("This might actually start to make sense...")
28th Jul 2016, 1:25 AM
Frédéric Charette
Frédéric Charette - avatar