Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> def deco(method):
- ... def wrapped(*a, **kw):
- ... retval = method(*a, **kw)
- ... return retval
- ... return wrapped
- ...
- >>>
- >>> def foo():
- ... return 4
- ...
- >>> foo.__name__
- 'foo'
- >>> foo = deco(foo)
- >>> foo.__name__
- 'wrapped'
- >>>
Add Comment
Please, Sign In to add comment