There could be other modes, such as `mode="repeat"` which reuses the last value of each iterator as a fillvalue, or `mode="wrap"` which is similar to `zip(*(it.cycle(x) for x in its))`.

So indeed a binary flag protects from additional requests to further overload that function. This can be a good thing but it could also miss on (future) opportunities.


On 04.05.20 16:55, Ricky Teachey wrote:
I'm wondering if a `mode` (or similar) keyword argument, with multiple possible options, should be included in the "rejected" section of the PEP.

zip(*args, mode="longest")  <-- default
zip(*args, mode="equal")  <-- or "even"

An advantage of this way is if the option to zip in different ways proves popular, you could later add zip shortest as an option, and maybe others I'm not smart enough to think of:

zip(*args, mode="shortest")

The PEP should argue against doing this since `strict= True or False` forever limits you to only two modes of zipping.

---
Ricky.

"I've never met a Kentucky man who wasn't either thinking about going home or actually going home." - Happy Chandler


_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@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/35KD5VWNOOYOKGE7M2B7RTBTFQ2N7ZNM/
Code of Conduct: http://python.org/psf/codeofconduct/