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 <steve@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