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