Skip to content

Instantly share code, notes, and snippets.

@pminkov
Created February 14, 2016 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pminkov/47adf92453687f9d529b to your computer and use it in GitHub Desktop.
Save pminkov/47adf92453687f9d529b to your computer and use it in GitHub Desktop.
def square(func):
def inner(x):
r = func(x)
r = r * r
return r
return inner
def plus5(x):
return x + 5
@square
def plus3(x):
return x + 3
print plus5(3)
print plus3(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment