Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. def mydec(func, param):
  2. def wrapped_function(*arg, **kwarg):
  3. func(*arg, **kwarg)
  4. return wrapped_function
  5.  
  6. @mydec('Hello, world')
  7. def echo(string):
  8. print(string)
  9.  
  10. echo('Compu')
  11.  
  12. '''Output:
  13. Hello, world
  14. Compu'''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement