[pypy-svn] r39699 - in pypy/dist/pypy/objspace/std: . test

gbrandl at codespeak.net gbrandl at codespeak.net
Fri Mar 2 16:12:37 CET 2007


Author: gbrandl
Date: Fri Mar  2 16:12:35 2007
New Revision: 39699

Modified:
   pypy/dist/pypy/objspace/std/listmultiobject.py
   pypy/dist/pypy/objspace/std/test/test_listmultiobject.py
Log:
bug in StrList.delitem.



Modified: pypy/dist/pypy/objspace/std/listmultiobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/listmultiobject.py	(original)
+++ pypy/dist/pypy/objspace/std/listmultiobject.py	Fri Mar  2 16:12:35 2007
@@ -343,11 +343,11 @@
             start += step
         return StrListImplementation(self.space, res)
 
-    def delitem(self, index):
+    def delitem(self, i):
         assert 0 <= i < len(self.strlist)
         if len(self.strlist) == 1:
             return self.space.fromcache(State).empty_impl
-        del self.strlist[index]
+        del self.strlist[i]
         return self
 
     def delitem_slice(self, start, stop):

Modified: pypy/dist/pypy/objspace/std/test/test_listmultiobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/test_listmultiobject.py	(original)
+++ pypy/dist/pypy/objspace/std/test/test_listmultiobject.py	Fri Mar  2 16:12:35 2007
@@ -21,6 +21,11 @@
         l = ["1", "2", "3", "4", "5"]
         assert "StrListImplementation" in pypymagic.pypy_repr(l)
 
+    def test_strlist_delitem(self):
+        l = ["1", "2"]
+        del l[0]
+        assert l == ["2"]
+
     def test_strlist_append(self):
         import pypymagic
         l = []



More information about the Pypy-commit mailing list