[pypy-svn] r69437 - in pypy/branch/unpackiterable-improvements/pypy: module/rctime module/select objspace/std

fijal at codespeak.net fijal at codespeak.net
Thu Nov 19 13:12:32 CET 2009


Author: fijal
Date: Thu Nov 19 13:12:32 2009
New Revision: 69437

Modified:
   pypy/branch/unpackiterable-improvements/pypy/module/rctime/interp_time.py
   pypy/branch/unpackiterable-improvements/pypy/module/select/interp_select.py
   pypy/branch/unpackiterable-improvements/pypy/objspace/std/dictmultiobject.py
   pypy/branch/unpackiterable-improvements/pypy/objspace/std/listobject.py
   pypy/branch/unpackiterable-improvements/pypy/objspace/std/ropeunicodeobject.py
   pypy/branch/unpackiterable-improvements/pypy/objspace/std/stringobject.py
   pypy/branch/unpackiterable-improvements/pypy/objspace/std/typetype.py
   pypy/branch/unpackiterable-improvements/pypy/objspace/std/unicodeobject.py
Log:
move a couple of places from unpackiterable to listview


Modified: pypy/branch/unpackiterable-improvements/pypy/module/rctime/interp_time.py
==============================================================================
--- pypy/branch/unpackiterable-improvements/pypy/module/rctime/interp_time.py	(original)
+++ pypy/branch/unpackiterable-improvements/pypy/module/rctime/interp_time.py	Thu Nov 19 13:12:32 2009
@@ -222,7 +222,7 @@
                 space.wrap(_get_error_msg()))
         return pbuf
 
-    tup_w = space.unpackiterable(w_tup)
+    tup_w = space.fixedview(w_tup)
     if len(tup_w) != 9:
         raise OperationError(space.w_TypeError, 
                              space.wrap("argument must be sequence of "

Modified: pypy/branch/unpackiterable-improvements/pypy/module/select/interp_select.py
==============================================================================
--- pypy/branch/unpackiterable-improvements/pypy/module/select/interp_select.py	(original)
+++ pypy/branch/unpackiterable-improvements/pypy/module/select/interp_select.py	Thu Nov 19 13:12:32 2009
@@ -113,9 +113,9 @@
 On Windows, only sockets are supported; on Unix, all file descriptors.
 """
 
-    iwtd_w = space.unpackiterable(w_iwtd)
-    owtd_w = space.unpackiterable(w_owtd)
-    ewtd_w = space.unpackiterable(w_ewtd)
+    iwtd_w = space.listview(w_iwtd)
+    owtd_w = space.listview(w_owtd)
+    ewtd_w = space.listview(w_ewtd)
     iwtd = [as_fd_w(space, w_f) for w_f in iwtd_w]
     owtd = [as_fd_w(space, w_f) for w_f in owtd_w]
     ewtd = [as_fd_w(space, w_f) for w_f in ewtd_w]

Modified: pypy/branch/unpackiterable-improvements/pypy/objspace/std/dictmultiobject.py
==============================================================================
--- pypy/branch/unpackiterable-improvements/pypy/objspace/std/dictmultiobject.py	(original)
+++ pypy/branch/unpackiterable-improvements/pypy/objspace/std/dictmultiobject.py	Thu Nov 19 13:12:32 2009
@@ -650,7 +650,7 @@
     if w_src is None:
         pass
     elif space.findattr(w_src, space.wrap("keys")) is None:
-        list_of_w_pairs = space.unpackiterable(w_src)
+        list_of_w_pairs = space.listview(w_src)
         for w_pair in list_of_w_pairs:
             pair = space.fixedview(w_pair)
             if len(pair)!=2:
@@ -793,7 +793,7 @@
         return w_default
 
 def dict_pop__DictMulti_ANY(space, w_dict, w_key, w_defaults):
-    defaults = space.unpackiterable(w_defaults)
+    defaults = space.listview(w_defaults)
     len_defaults = len(defaults)
     if len_defaults > 1:
         raise OperationError(space.w_TypeError, space.wrap("pop expected at most 2 arguments, got %d" % (1 + len_defaults, )))

Modified: pypy/branch/unpackiterable-improvements/pypy/objspace/std/listobject.py
==============================================================================
--- pypy/branch/unpackiterable-improvements/pypy/objspace/std/listobject.py	(original)
+++ pypy/branch/unpackiterable-improvements/pypy/objspace/std/listobject.py	Thu Nov 19 13:12:32 2009
@@ -260,11 +260,7 @@
     _setitem_slice_helper(space, w_list, start, step, slicelength, w_iterable)
 
 def _setitem_slice_helper(space, w_list, start, step, slicelength, w_iterable):
-    if isinstance(w_iterable, W_ListObject):
-        sequence2 = w_iterable.wrappeditems
-    else:
-        sequence2 = space.unpackiterable(w_iterable)
-
+    sequence2 = space.listview(w_iterable)
     assert slicelength >= 0
     items = w_list.wrappeditems
     oldsize = len(items)
@@ -357,7 +353,7 @@
     return space.w_None
 
 def list_extend__List_ANY(space, w_list, w_any):
-    w_list.wrappeditems += space.unpackiterable(w_any)
+    w_list.wrappeditems += space.listview(w_any)
     return space.w_None
 
 # note that the default value will come back wrapped!!!

Modified: pypy/branch/unpackiterable-improvements/pypy/objspace/std/ropeunicodeobject.py
==============================================================================
--- pypy/branch/unpackiterable-improvements/pypy/objspace/std/ropeunicodeobject.py	(original)
+++ pypy/branch/unpackiterable-improvements/pypy/objspace/std/ropeunicodeobject.py	Thu Nov 19 13:12:32 2009
@@ -233,7 +233,7 @@
     return space.contains(unicode_from_string(space, w_container), w_item )
 
 def unicode_join__RopeUnicode_ANY(space, w_self, w_list):
-    l_w = space.unpackiterable(w_list)
+    l_w = space.listview(w_list)
     delim = w_self._node
     totlen = 0
     if len(l_w) == 0:

Modified: pypy/branch/unpackiterable-improvements/pypy/objspace/std/stringobject.py
==============================================================================
--- pypy/branch/unpackiterable-improvements/pypy/objspace/std/stringobject.py	(original)
+++ pypy/branch/unpackiterable-improvements/pypy/objspace/std/stringobject.py	Thu Nov 19 13:12:32 2009
@@ -349,7 +349,7 @@
                                                        sliced)
 
 def str_join__String_ANY(space, w_self, w_list):
-    list_w = space.unpackiterable(w_list)
+    list_w = space.listview(w_list)
     str_w = space.str_w
     if list_w:
         self = w_self._value

Modified: pypy/branch/unpackiterable-improvements/pypy/objspace/std/typetype.py
==============================================================================
--- pypy/branch/unpackiterable-improvements/pypy/objspace/std/typetype.py	(original)
+++ pypy/branch/unpackiterable-improvements/pypy/objspace/std/typetype.py	Thu Nov 19 13:12:32 2009
@@ -38,7 +38,7 @@
     name = space.str_w(w_name)
     assert isinstance(name, str)
     dict_w = {}
-    dictkeys_w = space.unpackiterable(w_dict)
+    dictkeys_w = space.listview(w_dict)
     for w_key in dictkeys_w:
         key = space.str_w(w_key)
         dict_w[key] = space.getitem(w_dict, w_key)

Modified: pypy/branch/unpackiterable-improvements/pypy/objspace/std/unicodeobject.py
==============================================================================
--- pypy/branch/unpackiterable-improvements/pypy/objspace/std/unicodeobject.py	(original)
+++ pypy/branch/unpackiterable-improvements/pypy/objspace/std/unicodeobject.py	Thu Nov 19 13:12:32 2009
@@ -173,7 +173,7 @@
     return space.newbool(container.find(item) != -1)
 
 def unicode_join__Unicode_ANY(space, w_self, w_list):
-    l = space.unpackiterable(w_list)
+    l = space.listview(w_list)
     delim = w_self._value
     totlen = 0
     if len(l) == 0:



More information about the Pypy-commit mailing list