Make built-in zip() equal to itertools.izip().

I mea, *really* equal -- for now, the implementation just imports
itertools. :-)
The only other changes necessary were various unit tests that were
assuming zip() returns a real list.  No "real" code made this assumption.
This commit is contained in:
Guido van Rossum 2006-08-24 19:48:10 +00:00
parent d38abe9484
commit 801f0d78b5
6 changed files with 62 additions and 139 deletions

View file

@ -61,7 +61,7 @@ class TupleTest(seq_tests.CommonTest):
base = range(N)
xp = [(i, j) for i in base for j in base]
inps = base + [(i, j) for i in base for j in xp] + \
[(i, j) for i in xp for j in base] + xp + zip(base)
[(i, j) for i in xp for j in base] + xp + list(zip(base))
collisions = len(inps) - len(set(map(hash, inps)))
self.assert_(collisions <= 15)