On Sun, May 03, 2020 at 09:41:00PM -0700, Christopher Barker wrote: > On Sun, May 3, 2020 at 6:17 PM Steven D'Aprano <st...@pearwood.info> wrote: > > > > > map(func, x, y, strict=True) # ? > > > > > > > > Admittedly the word "strict" in the context of `map` would be rather > > > > confusing. > > > > > > > > > > This a really good argument for "equal" rather than "strict". > > > > Sorry, I'm not seeing why this would be confusing for `map` but not > > `zip`. And "equal" might suggest that x and y need to be equal. > > > > of course it would be confusing for zip.
Dominik seems to think that it is acceptable for zip but confusing for map, so I don't think that any confusion deserves to be described with "of course". At least, it's not obvious to me why it is confusing. We currently have a pair of zip functions that are tolerant of mismatched data: zip stops at the shortest input, and zip_longest pads the input. This proposal would be a strict version of zip. [...] > > Perhaps "truncate" or even "trunc" is a better keyword than either > > strict or equal. Not that I'm arguing for a keyword here. > > > > But it wouldn't be truncating anything. `truncate=True` would be the current behaviour, which truncates at the shortest input: py> list(zip('a', range(100000))) [('a', 0)] -- Steven _______________________________________________ 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/L4534OMAMBDP4OLNLBAWNQXXKY7GAN27/ Code of Conduct: http://python.org/psf/codeofconduct/