[pypy-commit] pypy unsigned-dtypes: remove iter stuff that I hadn't intended to merge

justinpeel noreply at buildbot.pypy.org
Mon Oct 3 20:07:06 CEST 2011


Author: Justin Peel <notmuchtotell at gmail.com>
Branch: unsigned-dtypes
Changeset: r47799:e08fe0a276cb
Date: 2011-10-03 12:02 -0600
http://bitbucket.org/pypy/pypy/changeset/e08fe0a276cb/

Log:	remove iter stuff that I hadn't intended to merge

diff --git a/pypy/objspace/std/iterobject.py b/pypy/objspace/std/iterobject.py
--- a/pypy/objspace/std/iterobject.py
+++ b/pypy/objspace/std/iterobject.py
@@ -35,32 +35,16 @@
         w_self.listitems = wrappeditems
 
 class W_FastTupleIterObject(W_AbstractSeqIterObject):
-    """Sequence iterator specialized for tuples, accessing
-    directly their RPython-level list of wrapped objects.
-    """
-    def __init__(w_self, w_seq, wrappeditems):
+   """Sequence iterator specialized for tuples, accessing
+   directly their RPython-level list of wrapped objects.
+   """ 
+   def __init__(w_self, w_seq, wrappeditems):
         W_AbstractSeqIterObject.__init__(w_self, w_seq)
         w_self.tupleitems = wrappeditems
 
-class W_FastStringIterObject(W_AbstractSeqIterObject):
-    """Sequence iterator specialized for strings, accessing
-    directly their RPython string.
-    """
-    def __init__(w_self, w_seq, value):
-        W_AbstractSeqIterObject.__init__(w_self, w_seq)
-        w_self.chars = value
-
-class W_FastUnicodeIterObject(W_AbstractSeqIterObject):
-    """Sequence iterator specialized for strings, accessing
-    directly their RPython string.
-    """
-    def __init__(w_self, w_seq, value):
-        W_AbstractSeqIterObject.__init__(w_self, w_seq)
-        w_self.unichars = value
-
 class W_ReverseSeqIterObject(W_Object):
     from pypy.objspace.std.itertype import reverse_iter_typedef as typedef
-
+    
     def __init__(w_self, space, w_seq, index=-1):
         w_self.w_seq = w_seq
         w_self.w_len = space.len(w_seq)
@@ -70,8 +54,6 @@
 registerimplementation(W_SeqIterObject)
 registerimplementation(W_FastListIterObject)
 registerimplementation(W_FastTupleIterObject)
-registerimplementation(W_FastStringIterObject)
-registerimplementation(W_FastUnicodeIterObject)
 registerimplementation(W_ReverseSeqIterObject)
 
 def iter__SeqIter(space, w_seqiter):
@@ -137,48 +119,6 @@
 ##    return w_seqiter.getlength(space)
 
 
-def iter__FastStringIter(space, w_seqiter):
-    return w_seqiter
-
-def next__FastStringIter(space, w_seqiter):
-    if w_seqiter.chars is None:
-        raise OperationError(space.w_StopIteration, space.w_None)
-    index = w_seqiter.index
-    try:
-        s = w_seqiter.chars[index]
-    except IndexError:
-        w_seqiter.chars = None
-        w_seqiter.w_seq = None
-        raise OperationError(space.w_StopIteration, space.w_None) 
-    w_seqiter.index = index + 1
-    return space.wrap(s)
-
-# XXX __length_hint__()
-##def len__FastStringIter(space, w_seqiter):
-##    return w_seqiter.getlength(space)
-
-
-def iter__FastUnicodeIter(space, w_seqiter):
-    return w_seqiter
-
-def next__FastUnicodeIter(space, w_seqiter):
-    if w_seqiter.unichars is None:
-        raise OperationError(space.w_StopIteration, space.w_None)
-    index = w_seqiter.index
-    try:
-        s = w_seqiter.unichars[index]
-    except IndexError:
-        w_seqiter.unichars = None
-        w_seqiter.w_seq = None
-        raise OperationError(space.w_StopIteration, space.w_None) 
-    w_seqiter.index = index + 1
-    return space.wrap(s)
-
-# XXX __length_hint__()
-##def len__FastUnicodeIter(space, w_seqiter):
-##    return w_seqiter.getlength(space)
-
-
 def iter__ReverseSeqIter(space, w_seqiter):
     return w_seqiter
 
diff --git a/pypy/objspace/std/model.py b/pypy/objspace/std/model.py
--- a/pypy/objspace/std/model.py
+++ b/pypy/objspace/std/model.py
@@ -122,8 +122,6 @@
             iterobject.W_SeqIterObject: [],
             iterobject.W_FastListIterObject: [],
             iterobject.W_FastTupleIterObject: [],
-            iterobject.W_FastStringIterObject: [],
-            iterobject.W_FastUnicodeIterObject: [],
             iterobject.W_ReverseSeqIterObject: [],
             unicodeobject.W_UnicodeObject: [],
             dictmultiobject.W_DictViewKeysObject: [],
diff --git a/pypy/objspace/std/stringobject.py b/pypy/objspace/std/stringobject.py
--- a/pypy/objspace/std/stringobject.py
+++ b/pypy/objspace/std/stringobject.py
@@ -863,10 +863,6 @@
     else:
         return sliced(space, s, start, stop, w_str)
 
-def iter__String(space, w_str):
-    from pypy.objspace.std import iterobject
-    return iterobject.W_FastStringIterObject(w_str, w_str._value)
-
 def mul_string_times(space, w_str, w_times):
     try:
         mul = space.getindex_w(w_times, space.w_OverflowError)
diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -265,10 +265,6 @@
     start, stop = normalize_simple_slice(space, len(uni), w_start, w_stop)
     return W_UnicodeObject(uni[start:stop])
 
-def iter__Unicode(space, w_uni):
-    from pypy.objspace.std import iterobject
-    return iterobject.W_FastUnicodeIterObject(w_uni, w_uni._value)
-
 def mul__Unicode_ANY(space, w_uni, w_times):
     try:
         times = space.getindex_w(w_times, space.w_OverflowError)


More information about the pypy-commit mailing list