[pypy-svn] pypy default: Test and fix.

arigo commits-noreply at bitbucket.org
Tue Jan 25 17:47:57 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41307:87d3ea765ee6
Date: 2011-01-24 15:57 +0100
http://bitbucket.org/pypy/pypy/changeset/87d3ea765ee6/

Log:	Test and fix.

diff --git a/pypy/module/itertools/test/test_itertools.py b/pypy/module/itertools/test/test_itertools.py
--- a/pypy/module/itertools/test/test_itertools.py
+++ b/pypy/module/itertools/test/test_itertools.py
@@ -369,6 +369,8 @@
             assert it.next() == x
         raises(StopIteration, it.next)
 
+        assert list(itertools.starmap(operator.add, [iter((40,2))])) == [42]
+
     def test_starmap_wrongargs(self):
         import itertools
 

diff --git a/pypy/module/itertools/interp_itertools.py b/pypy/module/itertools/interp_itertools.py
--- a/pypy/module/itertools/interp_itertools.py
+++ b/pypy/module/itertools/interp_itertools.py
@@ -721,9 +721,6 @@
 
     def next_w(self):
         w_obj = self.space.next(self.w_iterable)
-        if not self.space.is_true(self.space.isinstance(w_obj, self.space.w_tuple)):
-            raise OperationError(self.space.w_TypeError, self.space.wrap("iterator must return a tuple"))
-
         return self.space.call(self.w_fun, w_obj)
 
 def W_StarMap___new__(space, w_subtype, w_fun, w_iterable):


More information about the Pypy-commit mailing list