Created
October 15, 2015 11:27
-
-
Save tsyber1an/f8667079bd863623aa9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def beg(target_function): | |
@wraps(target_function) | |
def wrapper(*args, **kwargs): | |
msg, say_please = target_function(*args, **kwargs) | |
if say_please: | |
return "{} {}".format(msg, "Please! I am poor :(") | |
return msg | |
return wrapper | |
@beg | |
def say(say_please=False): | |
msg = "Can you buy me a beer?" | |
return msg, say_please |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment