On Tue, Apr 21, 2020 at 12:25:06PM -0700, Andrew Barnert via Python-ideas wrote:
> 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.

Why?

I know that the Python community has a love-affair with more-itertools, 
but I don't think that it is a well-designed library offering good APIs. 
It's a grab-bag of "everything including the kitchen sink". Just because 
they use a distinct exception doesn't mean we should follow them.


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

Reply via email to