Skip to content

Instantly share code, notes, and snippets.

@fredrikaverpil
Created October 21, 2019 07:32
Show Gist options
  • Save fredrikaverpil/657696565904b6b22f2afb2bc2cecda4 to your computer and use it in GitHub Desktop.
Save fredrikaverpil/657696565904b6b22f2afb2bc2cecda4 to your computer and use it in GitHub Desktop.
Decorators
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