On Apr 21, 2020, at 01:36, Serhiy Storchaka <storch...@gmail.com> wrote:
> 
>    except ValueError: # assuming that’s the exception you want?

For what it’s worth, more_itertools.zip_equal raises an UnequalIterablesError, 
which is a subclass of ValueError.

I’m not sure whether having a special error class is worth it, but that’s 
because nobody’s providing any examples of code where they’d want to handle 
this error. Presumably there are cases where something else in the expression 
could raise a ValueError for a different reason, and being able to catch this 
one instead of that one would be worthwhile. But how often? No idea.

At a guess, I’d say that if this has to be a builtin (whether flag-switchable 
behavior in zip or a new builtin function) it’s probably not worth adding a new 
builtin exception, but if it’s going to go into itertools it probably is worth 
it.

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

Reply via email to