Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A = None
- def my_decorator(func):
- global A
- A = func
- def wrapper():
- print("Something is happening before the function is called.")
- func()
- print("Something is happening after the function is called.")
- return wrapper
- @my_decorator
- def say_whee():
- print("Wheeeeee!")
- say_whee()
- print('======')
- A()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement