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

Steven D'Aprano steve at pearwood.info
Wed May 25 22:32:29 EDT 2016

On Tue, May 24, 2016 at 07:04:46PM -0700, Guido van Rossum wrote:

> Is there really something here that needs to be fixed?

I'm not sure.

As the OP, I was hoping that there would be a simple and obvious "yes, 
we can change this". But it's not that simple.

It seems to me that the annoyance of the current inconsistent and 
idiosyncratic exceptions is not obviously greater than the pain of 
"fixing" the problem. Even if we agreed on what the fix should be. So I 
am prepared to let this go as a "won't fix":

- people who try to guess what exceptions are raised are on shaky 
  ground, especially beginners, and should read the docs or try 
  things out in the REPL;

- the current exception hierarchy may, or may not, be illogical,
  but it would be more painful to change it than live with it.


More information about the Python-ideas mailing list