Created
October 19, 2019 03:53
-
-
Save adrianmarkperea/f2c0b421755ae4a8f3c8c0d443c9b957 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def call_three_times(fun): | |
def wrapper(*args, **kwargs): | |
fun(*args, **kwargs) | |
fun(*args, **kwargs) | |
res = fun(*args, **kwargs) | |
return res | |
return wrapper | |
@call_three_times | |
def say_hey(): | |
print('Hey!') | |
say_hey() | |
# Output | |
Hey! | |
Hey! | |
Hey! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment