diff --git a/decorators.py b/decorators.py new file mode 100644 index 0000000..0df6c8e --- /dev/null +++ b/decorators.py @@ -0,0 +1,5 @@ +def do_twice(func): + def wrapper_do_twice(): + func() + func() + return wrapper_do_twice diff --git a/hello_decorator.py b/hello_decorator.py index 0c792e5..869dbe2 100644 --- a/hello_decorator.py +++ b/hello_decorator.py @@ -5,6 +5,7 @@ def decorator(func): print("Something is happening after the function is called.") return wrapper +@decorator def say_whee(): print("Whee!")