Skip to content

Instantly share code, notes, and snippets.

@Kaundur
Created June 9, 2019 19:41
def uppercase_decorator(func):
def wrapper():
# Get the output of the original function
output = func()
# Modify the original output and return it
return output.upper()
# return the wrapper used to modify the decorated function
return wrapper
@uppercase_decorator
def say_hello():
return 'hello'
>>> say_hello()
HELLO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment