Skip to content

Instantly share code, notes, and snippets.

@elyssonmr
Last active November 30, 2017 17:50
Show Gist options
  • Save elyssonmr/b7ef94dacbd99a8ddf6d7f4f33bceefa to your computer and use it in GitHub Desktop.
Save elyssonmr/b7ef94dacbd99a8ddf6d7f4f33bceefa to your computer and use it in GitHub Desktop.
Complexo
import functools
from http_module import HTTPClient()
def _do_upload_something(client, something_headers, something_body):
client.post("my_url", something_body, headers=something_headers)
client = HTTPClient()
upload_something = functools.partial(_do_upload_something, client)
# Someone calls this function as a callback just like that
upload_something(headers, body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment