Skip to content

Instantly share code, notes, and snippets.

@psav
Last active January 4, 2016 09:19
Show Gist options
  • Save psav/8600888 to your computer and use it in GitHub Desktop.
Save psav/8600888 to your computer and use it in GitHub Desktop.
Defer
>>> def defer(func, *args):
... return partial(partial, func)(*args)
...
>>> defer(max, [1,2,3])
<functools.partial object at 0xe411b0>
>>> p = defer(max, [1,2,3])
>>> p()
3
>>>
>>> b = partial(max, [1,2,3])
>>> b
<functools.partial object at 0xe411b0>
>>> b()
3
>>>
hahaha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment