0
What is the need of wrap here??
def decor(func): def wrap(): print("============") func() print("============") return wrap def print_text(): print("Hello world!") print_text = decor(print_text) print_text() I have read many explanations but none were satisfactory.
2 Respostas
0
It's just a way to put those lines before and after the text. It would be a lot more readable though if you just took it out though.
- 1
Jackson O’Donnell removing it results in error