Created
November 17, 2020 20:12
-
-
Save eriky/902e18036e55c0eb8d039188b7292588 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 print_argument(func): | |
def wrapper(the_number): | |
print("Argument for", func.__name__, "is", the_number) | |
return func(the_number) | |
return wrapper | |
@print_argument | |
def add_one(x): | |
return x + 1 | |
print(add_one(1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment