mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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:
parent
ef0c42d4e5
commit
8572b4fedf
4 changed files with 96 additions and 28 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue