Skip to content

Instantly share code, notes, and snippets.

@dkhmelenko
Last active September 20, 2023 08:48
Show Gist options
  • Save dkhmelenko/9278ea70fc66890a0654fcbd10a6931c to your computer and use it in GitHub Desktop.
Save dkhmelenko/9278ea70fc66890a0654fcbd10a6931c to your computer and use it in GitHub Desktop.
Decorator with arguments
def authenticate(request):
def decorator(*args, **kwargs):
add_auth_headers()
request(*args, **kwargs)
def add_auth_headers():
...
return decorator
@authenticate
def get_employees(user):
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment