]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Generalize map() to work with iterators.
authorTim Peters <tim.peters@gmail.com>
Thu, 3 May 2001 23:54:49 +0000 (23:54 +0000)
committerTim Peters <tim.peters@gmail.com>
Thu, 3 May 2001 23:54:49 +0000 (23:54 +0000)
commit4e9afdca392668bc7e07c79d8af0f95ef497fba4
tree1d5fe4e4a32f838e7ae7189c49a7ae42fc139f51
parent6aebded915ac3ca6dcd99ea4bf3dfc47a31bab1e
Generalize map() to work with iterators.
NEEDS DOC CHANGES.
Possibly contentious:  The first time s.next() yields StopIteration (for
a given map argument s) is the last time map() *tries* s.next().  That
is, if other sequence args are longer, s will never again contribute
anything but None values to the result, even if trying s.next() again
could yield another result.  This is the same behavior map() used to have
wrt IndexError, so it's the only way to be wholly backward-compatible.
I'm not a fan of letting StopIteration mean "try again later" anyway.
Lib/test/test_iter.py
Misc/NEWS
Python/bltinmodule.c