Skip to content

Instantly share code, notes, and snippets.

@frodopwns
Created August 12, 2015 16:32
Show Gist options
  • Save frodopwns/23052c00f23e785e72aa to your computer and use it in GitHub Desktop.
Save frodopwns/23052c00f23e785e72aa to your computer and use it in GitHub Desktop.
partial func example
>>> from urlparse import urljoin
>>> from functools import partial
>>> api_url = "http://my-eve-api.com/api/"
>>> endpointer = partial(urljoin, api_url)
>>> endpointer("sites")
'http://my-eve-api.com/api/sites'
>>> endpointer("contacts")
'http://my-eve-api.com/api/contacts'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment