Skip to content

Instantly share code, notes, and snippets.

@saghul
Created November 20, 2010 15:40
Show Gist options
  • Save saghul/707904 to your computer and use it in GitHub Desktop.
Save saghul/707904 to your computer and use it in GitHub Desktop.
lambda example 5
In [1]: from functools import partial
In [2]: def sum(x,y):
...: return x+y
...:
In [3]: increment = 1
In [4]: f = pa
In [4]: f = partial(sum, increment)
In [5]: f(1)
Out[5]: 2
In [6]: f(3)
Out[6]: 4
In [7]: increment = 5
In [8]: f(1)
Out[8]: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment