Skip to content

Instantly share code, notes, and snippets.

@adrianmarkperea
Created October 19, 2019 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianmarkperea/f2c0b421755ae4a8f3c8c0d443c9b957 to your computer and use it in GitHub Desktop.
Save adrianmarkperea/f2c0b421755ae4a8f3c8c0d443c9b957 to your computer and use it in GitHub Desktop.
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