[Python-ideas] Should decimal.InvalidOperation subclass ValueError?

Guido van Rossum guido at python.org
Wed May 25 01:48:16 EDT 2016


Well, ZeroDivisionError doesn't derive from ValueError, does it? So it may
not be a good idea, but it's certainly a tradition.

On Tuesday, May 24, 2016, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> Guido van Rossum wrote:
>
>> It's very
>> common for modules to define their own root exception class.
>>
>
> And it's a nuisance when their exceptions only belong
> to their own private hierarchy and don't participate in
> any the standard classifications.
>
> I don't think Decimal is directly to blame here, because
> deriving its exceptions from ArithmeticError seems like
> a reasonable thing to do. What *doesn't* seem reasonable
> to me is that ArithmeticError doesn't derive from
> ValueError. So far nobody has explained why that's
> a good idea.
>
> --
> Greg
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
--Guido (mobile)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160524/c9aa5109/attachment-0001.html>


More information about the Python-ideas mailing list