Hi, I am a very newbie in this forum, being in this got a question to raise.
I keep getting errors while using the decorator function. Please assist me with your thoughts.
Here I have code for ‘decorator’ , the main program following the error.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
Dear Sanity, Thank you. I’ve had multiple trials to look forward to the return of wrapper function (the inner one), however, I don’t find any glitch over in the procedural functional.
Please help me.
Dear Sanity, You are obviously perfect. Yes, the called function in the inner method should be a First-class object and returned to the main program. The issue has been fixed with the following code.
def print_twice(func): @functools.wraps(func)
def wrapper_print_twice(*args, **kwargs):
value = func(*args, **kwargs)
return value
return wrapper_print_twice()