Decorator Line, Desugared
def add_prefix(func):
def wrapper(*args, **kwargs):
return "> " + func(*args, **kwargs)
return wrapper
@add_prefix
def shout(word):
return word.upper()
Which rewrite, with no @ syntax at all, produces exactly the same shout (same behavior when called, built at the same point in the module's execution)?
Sign in to answer questions and track your progress
Sign In