"strict" doesn't say what it's being strict about. That information has to be inferred by the reader. As a keyword argument I'd expect it to relate to the function's main purpose, so for `zip` I can understand how this refers to the arguments (since their items end up in the resulting tuples). However the main purpose of `map` is to produce new values, that depend on the provided function, so here the focus shifts from the input to the result. Hence I'd expect that `strict=True` refers to the produced values somehow (perhaps asserting that no value is produced twice). So if `zip` gets `strict=True` then I think it's clearer if `map` got `zip_strict=True`, as it's being explicit about its relation to the arguments. On 04.05.20 06:57, Guido van Rossum wrote:
I should really stay out of this (hundreds of messages and still bickering^Wbikeshedding :-), but I personally find strict=True *less* confusing than equal=True, both for zip() and for map(). If I didn't know what was going on, seeing equal=True would make me wonder about whether equality between the elements might be involved somehow.
On Sun, May 3, 2020 at 9:42 PM Christopher Barker
mailto:pythonchb@gmail.com> wrote: On Sun, May 3, 2020 at 6:17 PM Steven D'Aprano
mailto: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. I and others have been advocating for "equal" over "strict" for a whiie. this is yet another argument. Since I never liked "strict", I'm not sure I can argue why it might be more confusing or map than 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. If we want to be wordy, equal_length would do it -- but I wouldn't want to be that wordy.
-CHB
-- Christopher Barker, PhD
Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython _______________________________________________ Python-ideas mailing list -- python-ideas@python.org mailto:python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org mailto: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/DK3PG4... Code of Conduct: http://python.org/psf/codeofconduct/
-- --Guido van Rossum (python.org/~guido http://python.org/~guido) /Pronouns: he/him //(why is my pronoun here?)/ http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...
_______________________________________________ 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/OID2HS... Code of Conduct: http://python.org/psf/codeofconduct/