On Tue, May 5, 2020 at 7:20 AM Steven D'Aprano <st...@pearwood.info> wrote:

> On Mon, Apr 27, 2020 at 01:39:19PM -0700, Christopher Barker wrote:
>
> > Can you think of a single case where a zip_equal() (either pre-exisiting
> or
> > roll your own) would not work, but the concretizing version would?
>


> That's easy: if the body of your zip-handling function has side-effects
> which must be atomic (or at least as atomic as Python code will allow).
> An atomic function has to either LBYL (e.g. check the lengths of the
> iterables before starting to zip them), or needs to be able to roll-back
> if a mismatch is found at the end.
>

Good point. but the current "shortest" behavior would be even worse. At
least if it raised you'd get a warning that you made a mess of your data :-)

And yes, that's not an argument against this idea.

-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
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/PGTZFDBPZ74ORWEZDKFXHS7FSAT74S5N/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to