[pypy-svn] r69549 - pypy/branch/stringbuilder/pypy/objspace/std

fijal at codespeak.net fijal at codespeak.net
Mon Nov 23 13:07:45 CET 2009


Author: fijal
Date: Mon Nov 23 13:07:44 2009
New Revision: 69549

Modified:
   pypy/branch/stringbuilder/pypy/objspace/std/objspace.py
Log:
Kill expected_length argument here as well


Modified: pypy/branch/stringbuilder/pypy/objspace/std/objspace.py
==============================================================================
--- pypy/branch/stringbuilder/pypy/objspace/std/objspace.py	(original)
+++ pypy/branch/stringbuilder/pypy/objspace/std/objspace.py	Mon Nov 23 13:07:44 2009
@@ -643,7 +643,7 @@
             raise UnpackValueError("Expected length %d, got %d" % (expected_length, len(t)))
         return t
 
-    def fixedview(self, w_obj, expected_length=-1):
+    def fixedview(self, w_obj):
         """ Fast paths
         """
         if isinstance(w_obj, W_TupleObject):
@@ -651,20 +651,16 @@
         elif isinstance(w_obj, W_ListObject):
             t = w_obj.wrappeditems[:]
         else:
-            return ObjSpace.fixedview(self, w_obj, expected_length)
-        if expected_length != -1 and len(t) != expected_length:
-            raise UnpackValueError("Expected length %d, got %d" % (expected_length, len(t)))
+            return ObjSpace.fixedview(self, w_obj)
         return t
 
-    def listview(self, w_obj, expected_length=-1):
+    def listview(self, w_obj):
         if isinstance(w_obj, W_ListObject):
             t = w_obj.wrappeditems
         elif isinstance(w_obj, W_TupleObject):
             t = w_obj.wrappeditems[:]
         else:
-            return ObjSpace.listview(self, w_obj, expected_length)
-        if expected_length != -1 and len(t) != expected_length:
-            raise UnpackValueError("Expected length %d, got %d" % (expected_length, len(t)))
+            return ObjSpace.listview(self, w_obj)
         return t
 
     def sliceindices(self, w_slice, w_length):



More information about the Pypy-commit mailing list