Created
October 21, 2019 07:32
-
-
Save fredrikaverpil/657696565904b6b22f2afb2bc2cecda4 to your computer and use it in GitHub Desktop.
Decorators
This file contains hidden or 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 _my_decorator(func): | |
def wrapper(*args, **kwargs): | |
print("wrapper got args...", args) | |
print("wrapper got kwargs...", kwargs) | |
print("Something is happening before the function is called.") | |
func(*args, **kwargs) | |
print("Something is happening after the function is called.") | |
return wrapper | |
@_my_decorator | |
def say_whee(repo, new_version, release_branch, path_to_version_file, config, create_branch=False): | |
print("Whee!") | |
say_whee("repo", "new_version", "releasebranch", "some path", "config", False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment