<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>What I was trying to say was: I think of <br>
</p>
<p> ValueError as applying to a single ("bad") value</p>
<p> whereas ArithmeticError can arise from trying to combine
multiple ("good") values. It wouldn't be appropriate for
ArithmeticError to be a subclass of ValueError, because there is
no single erroneous value that you can point to.<br>
</p>
<br>
<div class="moz-cite-prefix">On 25/05/2016 09:08, Rob Cliffe wrote:<br>
</div>
<blockquote
cite="mid:0239b3c2-f795-6418-5b27-f61673c8f643@btinternet.com"
type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<p>Or more generally, any operation on multiple values, where each
value is valid individually, but the result of the operation is
not:</p>
<p>>>> p = Decimal('1E999999999')</p>
<p>>>> q = Decimal('10')</p>
<p>>>> try:</p>
<p>... p*q</p>
<p>... except ArithmeticError:</p>
<p>... print 'ArithmeticError'</p>
<p>...</p>
<p>ArithmeticError<br>
</p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 25/05/2016 06:48, Guido van Rossum
wrote:<br>
</div>
<blockquote
cite="mid:CAP7+vJLbiF0QnqBZLppHN8R5q8te6aFZ3UfXSRvt9O8VFqgTmg@mail.gmail.com"
type="cite">Well, ZeroDivisionError doesn't derive from
ValueError, does it? So it may not be a good idea, but it's
certainly a tradition.<br>
<br>
On Tuesday, May 24, 2016, Greg Ewing <<a
moz-do-not-send="true"
href="mailto:greg.ewing@canterbury.ac.nz"><a class="moz-txt-link-abbreviated" href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a></a>>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Guido van
Rossum wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"> It's very<br>
common for modules to define their own root exception class.<br>
</blockquote>
<br>
And it's a nuisance when their exceptions only belong<br>
to their own private hierarchy and don't participate in<br>
any the standard classifications.<br>
<br>
I don't think Decimal is directly to blame here, because<br>
deriving its exceptions from ArithmeticError seems like<br>
a reasonable thing to do. What *doesn't* seem reasonable<br>
to me is that ArithmeticError doesn't derive from<br>
ValueError. So far nobody has explained why that's<br>
a good idea.<br>
<br>
-- <br>
Greg<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a moz-do-not-send="true">Python-ideas@python.org</a><br>
<a moz-do-not-send="true"
href="https://mail.python.org/mailman/listinfo/python-ideas"
target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a moz-do-not-send="true"
href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote>
<br>
<br>
-- <br>
--Guido (mobile)<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Python-ideas mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Python-ideas@python.org">Python-ideas@python.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/python-ideas">https://mail.python.org/mailman/listinfo/python-ideas</a>
Code of Conduct: <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://python.org/psf/codeofconduct/">http://python.org/psf/codeofconduct/</a></pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Python-ideas mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python-ideas@python.org">Python-ideas@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/python-ideas">https://mail.python.org/mailman/listinfo/python-ideas</a>
Code of Conduct: <a class="moz-txt-link-freetext" href="http://python.org/psf/codeofconduct/">http://python.org/psf/codeofconduct/</a></pre>
</blockquote>
<br>
</body>
</html>