Skip to content

Instantly share code, notes, and snippets.

@nikicat
Created November 14, 2013 15:48
Show Gist options
  • Save nikicat/7469093 to your computer and use it in GitHub Desktop.
Save nikicat/7469093 to your computer and use it in GitHub Desktop.
pickle pypy3
import pickle
def f1():
def f2(a):
print(a*a)
return f2
with open('f2.pickle', 'w+') as f:
f.write(pickle.dumps(f1()))
********************
import pickle
pickle.load(open('f2.pickle'))(2)
>> 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment