aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pypy/interpreter/baseobjspace.py4
-rw-r--r--pypy/module/itertools/interp_itertools.py6
-rw-r--r--pypy/module/itertools/test/test_itertools.py1
3 files changed, 1 insertions, 10 deletions
diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
index 23bb22dc39..63a236d626 100644
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -22,7 +22,7 @@ UINT_MAX_32_BITS = r_uint(4294967295)
unpackiterable_driver = jit.JitDriver(name = 'unpackiterable',
greens = ['tp'],
- reds = ['items', 'w_item', 'w_iterator'])
+ reds = ['items', 'w_iterator'])
class W_Root(object):
"""This is the abstract root class of all wrapped objects that live
@@ -875,11 +875,9 @@ class ObjSpace(object):
items = [] # it might have lied
#
tp = self.type(w_iterator)
- w_item = None
while True:
unpackiterable_driver.jit_merge_point(tp=tp,
w_iterator=w_iterator,
- w_item=w_item, <-- why?
items=items)
try:
w_item = self.next(w_iterator)
diff --git a/pypy/module/itertools/interp_itertools.py b/pypy/module/itertools/interp_itertools.py
index 75e3fdd719..af283d94a5 100644
--- a/pypy/module/itertools/interp_itertools.py
+++ b/pypy/module/itertools/interp_itertools.py
@@ -112,11 +112,6 @@ class W_Repeat(Wrappable):
s = 'repeat(%s)' % (objrepr,)
return self.space.wrap(s)
- def len(self, space):
- if self.count == -1 or not self.counting:
- raise OperationError(space.w_TypeError, space.wrap('len() of unsized object'))
- return space.wrap(self.count)
-
def W_Repeat___new__(space, w_subtype, w_object, w_times=None):
r = space.allocate_instance(W_Repeat, w_subtype)
r.__init__(space, w_object, w_times)
@@ -129,7 +124,6 @@ W_Repeat.typedef = TypeDef(
__iter__ = interp2app(W_Repeat.iter_w),
next = interp2app(W_Repeat.next_w),
__repr__ = interp2app(W_Repeat.repr_w),
- __len__ = interp2app(W_Repeat.len),
__doc__ = """Make an iterator that returns object over and over again.
Runs indefinitely unless the times argument is specified. Used
as argument to imap() for invariant parameters to the called
diff --git a/pypy/module/itertools/test/test_itertools.py b/pypy/module/itertools/test/test_itertools.py
index aef859dbc6..61c905d810 100644
--- a/pypy/module/itertools/test/test_itertools.py
+++ b/pypy/module/itertools/test/test_itertools.py
@@ -93,7 +93,6 @@ class AppTestItertools:
r = itertools.repeat('a', 15)
r.next()
- assert len(r) == 14 <-- no, python 2.7 does not have len(r)
raises(TypeError, "len(itertools.repeat('xkcd'))")
def test_takewhile(self):