Compare commits
No commits in common. "7bfa1bc9dae81795acff4b93356885c338c5c0fe" and "228eef02580db7c3ff448a78cc79e695340d936f" have entirely different histories.
7bfa1bc9da
...
228eef0258
|
@ -1,5 +0,0 @@
|
||||||
def do_twice(func):
|
|
||||||
def wrapper_do_twice():
|
|
||||||
func()
|
|
||||||
func()
|
|
||||||
return wrapper_do_twice
|
|
|
@ -5,7 +5,6 @@ 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!")
|
||||||
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
from datetime import datetime
|
|
||||||
|
|
||||||
def not_during_the_night(func):
|
|
||||||
def wrapper():
|
|
||||||
if 7 <= datetime.now().hour < 22:
|
|
||||||
func()
|
|
||||||
else:
|
|
||||||
pass # Hush, the neighbors are asleep
|
|
||||||
return wrapper
|
|
||||||
|
|
||||||
def say_whee():
|
|
||||||
print("Whee!")
|
|
Loading…
Reference in New Issue