Python Iterables struggling using map() built-in

Chris Angelico rosuav at gmail.com
Sun Dec 7 19:35:36 EST 2014


On Mon, Dec 8, 2014 at 11:27 AM, Roy Smith <roy at panix.com> wrote:
> Although, to be honest, I'm wondering if this is more straight-forward
> (also not tested):
>
> def myzip37(*args):
>     if not args:
>         return
>     iters = list(map(iter, args))

Yes, I prefer this too. It's explicit and clear that passing no
arguments will yield no values.

ChrisA



More information about the Python-list mailing list