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

mwh at codespeak.net mwh at codespeak.net
Tue Feb 13 12:14:02 CET 2007


Author: mwh
Date: Tue Feb 13 12:14:01 2007
New Revision: 38673

Modified:
   pypy/dist/pypy/objspace/std/listmultiobject.py
   pypy/dist/pypy/objspace/std/test/test_listmultiobject.py
Log:
fix a bug in multilist shrinking slice assignments and unskip the relavent
tests.


Modified: pypy/dist/pypy/objspace/std/listmultiobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/listmultiobject.py	(original)
+++ pypy/dist/pypy/objspace/std/listmultiobject.py	Tue Feb 13 12:14:01 2007
@@ -922,7 +922,7 @@
                 i -= 1
         else:
             # shrinking requires the careful memory management of _del_slice()
-            _del_slice(w_list, start, start-delta)
+            impl = _del_slice(w_list, start, start-delta)
     elif len2 != slicelength:  # No resize for extended slices
         raise OperationError(space.w_ValueError, space.wrap("attempt to "
               "assign sequence of size %d to extended slice of size %d" %
@@ -1015,7 +1015,8 @@
     # keep a reference to the objects to be removed,
     # preventing side effects during destruction
     recycle = impl.getitem_slice(ilow, ihigh)
-    w_list.implementation = impl.i_delitem_slice(ilow, ihigh)
+    newimpl = w_list.implementation = impl.i_delitem_slice(ilow, ihigh)
+    return newimpl
 
 
 def list_pop__ListMulti_ANY(space, w_list, w_idx=-1):

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	Tue Feb 13 12:14:01 2007
@@ -32,9 +32,6 @@
         assert l == ["a", "b", "c", "d", "e", "f"]
         assert "StrListImplementation" in pypymagic.pypy_repr(l)
 
-    def test_ass_slice(self):
-        skip("failing")
-
 class AppTestRangeImplementation(AppTestRangeListObject):
 
     def setup_class(cls):
@@ -103,9 +100,6 @@
         del l1[:]
         assert "EmptyListImplementation" in pypymagic.pypy_repr(l1)
 
-    def test_ass_slice(self):
-        skip("failing")
-
 class TestSliceListImplementation(object):
     def setup_method(self,method):
         self.space = FakeSpace()



More information about the Pypy-commit mailing list