Skip to content

Instantly share code, notes, and snippets.

@built
Created July 20, 2014 06:17
Show Gist options
  • Save built/5517fc6ff2ac45d5bff6 to your computer and use it in GitHub Desktop.
Save built/5517fc6ff2ac45d5bff6 to your computer and use it in GitHub Desktop.
Walking the curry / object equivalence line in Python
to_image_name = "{.user_name}-{}-{}.png".format
# to_image_name is now a *function*.
# Use it later like so:
to_image_name(user, 32, 32)
# Which results in a string like: 'jsmith-32-32.png'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment