Skip to content

Instantly share code, notes, and snippets.

@bukzor
Created December 20, 2011 20:41
Show Gist options
  • Save bukzor/1503176 to your computer and use it in GitHub Desktop.
Save bukzor/1503176 to your computer and use it in GitHub Desktop.
from pylibmc.test import make_test_client
class Foo(object):
def __getstate__(self):
return dict(a=1)
def __setstate__(self, d):
assert d['a'] == 1
def break_pickling():
global Foo
Foo = object
def poke_memcache():
c = make_test_client()
c.set("test_key", Foo())
result = c.get_multi(['test_key'])
print 'RESULT(1):', result
break_pickling()
result = c.get_multi(['test_key'])
print 'RESULT(2):', result
def allocate_dicts():
mylist = []
for x in xrange(0):
mylist.append(dict(count=x))
# Entry point:
poke_memcache()
allocate_dicts()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment