decorator - Py iii <- pre function parameters
This commit is contained in:
parent
11acf9073d
commit
7bfa1bc9da
|
@ -0,0 +1,5 @@
|
||||||
|
def do_twice(func):
|
||||||
|
def wrapper_do_twice():
|
||||||
|
func()
|
||||||
|
func()
|
||||||
|
return wrapper_do_twice
|
|
@ -5,6 +5,7 @@ def decorator(func):
|
||||||
print("Something is happening after the function is called.")
|
print("Something is happening after the function is called.")
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
@decorator
|
||||||
def say_whee():
|
def say_whee():
|
||||||
print("Whee!")
|
print("Whee!")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue