Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
>>> def repeat(func):
... """Decorator that repeats function call twice"""
... def repeater(*args, **kwargs):
... func(*args, **kwargs)
... func(*args, **kwargs)
...
... return repeater
...
...
... @logging_time("ms")
... @repeat
... def say_hi(whom):
... print(f"Hi, {whom}!")
...
...
... @repeat
... @logging_time("ms")
... def say_hello(whom):
... print(f"Hello, {whom}!")
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment