On Thu, May 7, 2020 at 3:07 AM Christopher Barker <pythonchb@gmail.com> wrote:
On Wed, May 6, 2020 at 1:42 PM Kirill Balunov <kirillbalunov@gmail.com> wrote:
I'm totally agree with everything you said here. From my perspective, comparing three main cases:
1. zip(*iters, strict= (False | True))
2. zip(*iters, mode = ('shortest' | 'equal' | 'longest'))
3. zip_equal(*iters)

Thanks for enumerating these. I think that's helpful so I'll flesh it out a bit more. I *think* these are the options on the table:

(note, I'm keeping different names for things as the same option, and in no particular order)

1) No change
zip(*iters)
itertools.zip_longest(*iters, fillvalue=None)

2) Add boolean strict flag to zip
zip(*iters, strict= (False | True))
itertools.zip_longest(*iters, fillvalue=None)

3) Add a ternary mode flag to zip
zip(*iters, mode = ('shortest' | 'equal' | 'longest'), fillvalue=None)

4) Add a new function to itertools
zip(*iters)
itertools.zip_longest(*iters, fillvalue=None)
itertools.zip_equal(*iters)


I think there are two more cases which can be added to the list:

0) No change
zip(*iters)
itertools.zip_longest(*iters, fillvalue=None)
+ add a recipe about zip_equal in itertools docs

6) Add functionality through  zip methods (as proposed in a separate thread, but maybe it is off topic for the current thread).

-gdg