Skip to content

Instantly share code, notes, and snippets.

@yusukei
Created August 10, 2012 06:47
Show Gist options
  • Save yusukei/3311923 to your computer and use it in GitHub Desktop.
Save yusukei/3311923 to your computer and use it in GitHub Desktop.
>>> fs = []
>>> from pprint import pprint
>>>
>>> for i in range(4):
... a = str(i)
... func = lambda : pprint(a)
... fs.append(func)
...
>>> fs[0]()
'3'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment