[pypy-commit] pypy default: Test and fix.

arigo noreply at buildbot.pypy.org
Mon Sep 9 21:57:28 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r66876:0e2f0d910e8f
Date: 2013-09-09 21:55 +0200
http://bitbucket.org/pypy/pypy/changeset/0e2f0d910e8f/

Log:	Test and fix.

diff --git a/rpython/rtyper/rpbc.py b/rpython/rtyper/rpbc.py
--- a/rpython/rtyper/rpbc.py
+++ b/rpython/rtyper/rpbc.py
@@ -596,6 +596,9 @@
     def ll_str(self, none):
         return llstr("None")
 
+    def get_ll_eq_function(self):
+        return None
+
     def get_ll_hash_function(self):
         return ll_none_hash
 
diff --git a/rpython/rtyper/test/test_rdict.py b/rpython/rtyper/test/test_rdict.py
--- a/rpython/rtyper/test/test_rdict.py
+++ b/rpython/rtyper/test/test_rdict.py
@@ -1051,6 +1051,13 @@
         finally:
             lltype._array._check_range = original_check_range
 
+    def test_dict_with_none_key(self):
+        def func(i):
+            d = {None: i}
+            return d[None]
+        res = self.interpret(func, [42])
+        assert res == 42
+
 
 class TestStress:
 


More information about the pypy-commit mailing list