Skip to content

Instantly share code, notes, and snippets.

@dandye
Created March 29, 2013 03:02
Show Gist options
  • Save dandye/5268469 to your computer and use it in GitHub Desktop.
Save dandye/5268469 to your computer and use it in GitHub Desktop.
Decorator practice
def make_bold(fn):
def bold():
return "<b>{}</b>".format(fn())
return bold
def make_italic(fn):
def italic():
return "<i>{}</i>".format(fn())
return italic
@make_italic
@make_bold
def dec():
return "Hello, World!"
print dec()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment