Guest User

Untitled

a guest
Oct 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. >>> def deco(method):
  2. ... def wrapped(*a, **kw):
  3. ... retval = method(*a, **kw)
  4. ... return retval
  5. ... return wrapped
  6. ...
  7. >>>
  8. >>> def foo():
  9. ... return 4
  10. ...
  11. >>> foo.__name__
  12. 'foo'
  13. >>> foo = deco(foo)
  14. >>> foo.__name__
  15. 'wrapped'
  16. >>>
Add Comment
Please, Sign In to add comment