Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from functools import wraps
- def funcion_decoradora(fn):
- mensaje = fn.__qualname__
- @wraps(fn)
- def envoltura(*args, **kwargs):
- print(mensaje)
- return fn(*args, **kwargs)
- return envoltura
- @funcion_decoradora
- def sumar(x, y):
- return x + y
- print(sumar(5, 3))
- print()
- print(sumar.__wrapped__(5, 3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement