[pypy-commit] pypy non-null-app-dict: use hints as well as specify non-nullness for r_dict
fijal
noreply at buildbot.pypy.org
Tue Jun 28 14:34:45 CEST 2011
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: non-null-app-dict
Changeset: r45157:57859b8d80fb
Date: 2011-06-28 14:40 +0200
http://bitbucket.org/pypy/pypy/changeset/57859b8d80fb/
Log: use hints as well as specify non-nullness for r_dict
diff --git a/pypy/objspace/std/dictmultiobject.py b/pypy/objspace/std/dictmultiobject.py
--- a/pypy/objspace/std/dictmultiobject.py
+++ b/pypy/objspace/std/dictmultiobject.py
@@ -59,7 +59,8 @@
def initialize_as_rdict(self):
assert self.r_dict_content is None
- self.r_dict_content = r_dict(self.space.eq_w, self.space.hash_w)
+ self.r_dict_content = r_dict(self.space.eq_w, self.space.hash_w,
+ force_non_null=True)
return self.r_dict_content
@@ -317,6 +318,7 @@
self._as_rdict().impl_fallback_setitem(w_key, w_value)
def impl_setitem_str(self, key, w_value):
+ assert key is not None
self.content[key] = w_value
def impl_setdefault(self, w_key, w_default):
@@ -342,6 +344,7 @@
return len(self.content)
def impl_getitem_str(self, key):
+ assert key is not None
return self.content.get(key, None)
def impl_getitem(self, w_key):
More information about the pypy-commit
mailing list