Created
December 20, 2011 20:41
-
-
Save bukzor/1503176 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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