Author: Armin Rigo <[email protected]>
Branch:
Changeset: r44233:0605b7aa9005
Date: 2011-05-17 11:31 +0200
http://bitbucket.org/pypy/pypy/changeset/0605b7aa9005/
Log: (cfbolz, arigo)
Found bug B while looking for bug A in mapdict :-(
diff --git a/pypy/objspace/std/test/test_mapdict.py
b/pypy/objspace/std/test/test_mapdict.py
--- a/pypy/objspace/std/test/test_mapdict.py
+++ b/pypy/objspace/std/test/test_mapdict.py
@@ -902,7 +902,19 @@
return c.m()
val = f()
assert val == 42
- f()
+ f()
+
+ def test_bug_lookup_method_devolved_dict_caching(self):
+ class A(object):
+ def method(self):
+ return 42
+ a = A()
+ a.__dict__[1] = 'foo'
+ got = a.method()
+ assert got == 42
+ a.__dict__['method'] = lambda: 43
+ got = a.method()
+ assert got == 43
class AppTestGlobalCaching(AppTestWithMapDict):
def setup_class(cls):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit