On Wed, Apr 22, 2020 at 12:47 AM Brandt Bucher <brandtbuc...@gmail.com> wrote:
> Unlike some on this thread, I think the default behavior for `zip` is fine. 
> It's not broken, and it *should* be able to handle infinite iterables by 
> default. This isn't just a "band-aid" fix; it's a feature that allows many 
> (if not most) call sites to check an important assumption that's easy to 
> check inside zip (there's literally logic already handling this case) but 
> heavy to check at every call site.
>

In terms of shed colour, I think the proposed function would fit very
nicely alongside zip_longest in itertools. If people don't like the
default behaviour, it's easy to then change it: "from itertools import
zip_shortest as zip". (Or "zip_strict" or whatever the name ends up
being.) Easier that way than if it's a mode-switch keyword argument.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/7CZF6ISQEMEUO4U2FNKDUTT6UOWOUI2C/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to