On 8/21/06, Georg Brandl <[EMAIL PROTECTED]> wrote: > > + * Make map() and filter() iterators and make them stop at the end of the > > shortest input (like zip()) instead of at the end of the longest input > > May I suggest an additional keyword(-only?) argument to get the old behavior, > stopping at the end of the longest input?
I'd rather not. Why, apart from backwards compatibility? I'd like map(f, a, b) to be the same as to (f(*x) for x in zip(a, b)) so we have to explain less. (And I think even map(f, *args) === (f(*x) for x in zip(*args)).) The right way to write code that works in 2.6 and 3.0 is to only use inputs of the same length. Perhaps there could be (or is there already?) a helper in itertools that iterates over multiple iterables padding the shorter inputs with None to the length of the longest one. -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
