Skip to content

Instantly share code, notes, and snippets.

@dmi3coder
Last active November 27, 2019 15:02
Show Gist options
  • Save dmi3coder/45b6c007f7595f7d5a6d9a165a9e65fe to your computer and use it in GitHub Desktop.
Save dmi3coder/45b6c007f7595f7d5a6d9a165a9e65fe to your computer and use it in GitHub Desktop.
Our example of python decorators
def as_html(func):
def wrapper():
result = func()
return f'<html>{result}</html>'
return wrapper
@as_html
def say_hello():
return 'Hello'
print(say_hello())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment