Generalize zip() to work with iterators.

NEEDS DOC CHANGES.
More AttributeErrors transmuted into TypeErrors, in test_b2.py, and,
again, this strikes me as a good thing.
This checkin completes the iterator generalization work that obviously
needed to be done.  Can anyone think of others that should be changed?
This commit is contained in:
Tim Peters 2001-05-06 01:05:02 +00:00
parent ef0c42d4e5
commit 8572b4fedf
4 changed files with 96 additions and 28 deletions

View file

@ -309,13 +309,13 @@ class G:
exc = 0
try:
zip(a, G())
except AttributeError:
except TypeError:
exc = 1
except:
e = sys.exc_info()[0]
raise TestFailed, 'zip(a, b) - b instance w/o __getitem__'
if not exc:
raise TestFailed, 'zip(a, b) - missing expected AttributeError'
raise TestFailed, 'zip(a, b) - missing expected TypeError'
# Epilogue -- unlink the temp file