On 8/21/06, Collin Winter <[EMAIL PROTECTED]> wrote: > On 8/21/06, Michael Urman <[EMAIL PROTECTED]> wrote: > > On 8/21/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > 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)).) > > > > Should map(None, a, b) == zip(a, b), leaving python with multiple ways > > to do one thing? Or should the surprising but useful map(None, ...) > > behavior disappear or become even more surprising by padding? Is there > > any reason at all for map to take multiple sequences now that we have > > starmap and (i)zip? > > FWIW, I'm ambivalent as to whether map() accepts multiple sequences, > but I'm strongly in favor of map(None, ....) disappearing. Similarly, > I'd want to see filter(None, ...) go away, too; fastpathing the case > of filter(bool, ....) will achieve the same performance benefit.
I think map(f, a, b, ...) and filter(p, a, b, ...) should stay, but the None cases should be gotten rid of. I don't want to move starmap() out of itertools into builtins. I expect that filter(bool, a) is fast enough without greasing the tracks, but if you don't, feel free to benchmark it. -- --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
