Created
August 12, 2015 16:32
-
-
Save frodopwns/23052c00f23e785e72aa to your computer and use it in GitHub Desktop.
partial func example
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
>>> 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