[pypy-svn] rev 1047 - pypy/trunk/src/pypy/objspace/ann

gvanrossum at codespeak.net gvanrossum at codespeak.net
Tue Jun 24 15:14:40 CEST 2003


Author: gvanrossum
Date: Tue Jun 24 15:14:39 2003
New Revision: 1047

Modified:
   pypy/trunk/src/pypy/objspace/ann/objspace.py
Log:
Add setitem for limited cases.

Modified: pypy/trunk/src/pypy/objspace/ann/objspace.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/ann/objspace.py	(original)
+++ pypy/trunk/src/pypy/objspace/ann/objspace.py	Tue Jun 24 15:14:39 2003
@@ -290,6 +290,14 @@
             w_obj.setattr(name, w_value)
         # Space setattr shouldn't return anything, so no w_None here
 
+    def setitem(self, w_obj, w_key, w_value):
+        if (isinstance(w_obj, W_KnownKeysContainer) and
+            isinstance(w_key, W_Constant)):
+            key = self.unwrap(w_key)
+            w_obj.args_w[key] = w_value
+            return
+        # XXX How to record the side effect?
+
     def len(self, w_obj):
         if isinstance(w_obj, W_KnownKeysContainer):
             return self.wrap(len(w_obj))


More information about the Pypy-commit mailing list