[pypy-svn] r73666 - in pypy/trunk/pypy: interpreter objspace/std
benjamin at codespeak.net
benjamin at codespeak.net
Mon Apr 12 05:10:16 CEST 2010
Author: benjamin
Date: Mon Apr 12 05:10:15 2010
New Revision: 73666
Modified:
pypy/trunk/pypy/interpreter/baseobjspace.py
pypy/trunk/pypy/interpreter/pyopcode.py
pypy/trunk/pypy/objspace/std/dictmultiobject.py
pypy/trunk/pypy/objspace/std/objspace.py
Log:
rename set_str_keyed_item to setitem_str for consistency with other similar methods
Modified: pypy/trunk/pypy/interpreter/baseobjspace.py
==============================================================================
--- pypy/trunk/pypy/interpreter/baseobjspace.py (original)
+++ pypy/trunk/pypy/interpreter/baseobjspace.py Mon Apr 12 05:10:15 2010
@@ -42,7 +42,7 @@
def setdictvalue(self, space, attr, w_value, shadows_type=True):
w_dict = self.getdict()
if w_dict is not None:
- space.set_str_keyed_item(w_dict, attr, w_value, shadows_type)
+ space.setitem_str(w_dict, attr, w_value, shadows_type)
return True
return False
@@ -628,7 +628,7 @@
"""shortcut for space.int_w(space.hash(w_obj))"""
return self.int_w(self.hash(w_obj))
- def set_str_keyed_item(self, w_obj, key, w_value, shadows_type=True):
+ def setitem_str(self, w_obj, key, w_value, shadows_type=True):
return self.setitem(w_obj, self.wrap(key), w_value)
def finditem_str(self, w_obj, key):
Modified: pypy/trunk/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/trunk/pypy/interpreter/pyopcode.py (original)
+++ pypy/trunk/pypy/interpreter/pyopcode.py Mon Apr 12 05:10:15 2010
@@ -599,7 +599,7 @@
def STORE_NAME(self, varindex, next_instr):
varname = self.getname_u(varindex)
w_newvalue = self.popvalue()
- self.space.set_str_keyed_item(self.w_locals, varname, w_newvalue)
+ self.space.setitem_str(self.w_locals, varname, w_newvalue)
def DELETE_NAME(self, varindex, next_instr):
w_varname = self.getname_w(varindex)
@@ -638,7 +638,7 @@
def STORE_GLOBAL(self, nameindex, next_instr):
varname = self.getname_u(nameindex)
w_newvalue = self.popvalue()
- self.space.set_str_keyed_item(self.w_globals, varname, w_newvalue)
+ self.space.setitem_str(self.w_globals, varname, w_newvalue)
def DELETE_GLOBAL(self, nameindex, next_instr):
w_varname = self.getname_w(nameindex)
Modified: pypy/trunk/pypy/objspace/std/dictmultiobject.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/dictmultiobject.py (original)
+++ pypy/trunk/pypy/objspace/std/dictmultiobject.py Mon Apr 12 05:10:15 2010
@@ -102,9 +102,6 @@
else:
return None
- def set_str_keyed_item(w_dict, key, w_value, shadows_type=True):
- w_dict.setitem_str(key, w_value, shadows_type)
-
# _________________________________________________________________
# implementation methods
def impl_getitem(self, w_key):
Modified: pypy/trunk/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/trunk/pypy/objspace/std/objspace.py (original)
+++ pypy/trunk/pypy/objspace/std/objspace.py Mon Apr 12 05:10:15 2010
@@ -459,11 +459,11 @@
return w_obj.getitem(w_key)
return ObjSpace.finditem(self, w_obj, w_key)
- def set_str_keyed_item(self, w_obj, key, w_value, shadows_type=True):
+ def setitem_str(self, w_obj, key, w_value, shadows_type=True):
# performance shortcut to avoid creating the OperationError(KeyError)
if (isinstance(w_obj, W_DictMultiObject) and
not w_obj.user_overridden_class):
- w_obj.set_str_keyed_item(key, w_value, shadows_type)
+ w_obj.setitem_str(key, w_value, shadows_type)
else:
self.setitem(w_obj, self.wrap(key), w_value)
More information about the Pypy-commit
mailing list