Skip to content

Instantly share code, notes, and snippets.

@rweir
Forked from anonymous/gist:c564b4dfb63d065f3805
Last active January 3, 2016 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rweir/67af029321018ec1c49f to your computer and use it in GitHub Desktop.
Save rweir/67af029321018ec1c49f to your computer and use it in GitHub Desktop.
newdict = {}
for key, value in sorted(file.iteritems()):
action = actions.get(key)
if action:
newdict[key] = functools.partial(action, value)
else:
newdict[key] = lambda _: value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment