[issue15815] Add numerator to ZeroDivisionError messages

Ezio Melotti report at bugs.python.org
Fri Aug 31 18:42:53 CEST 2012


Ezio Melotti added the comment:

I'm not sure this is really useful.  Once I know that I divided by zero and I know where the division is, I don't really care what the numerator is.  Knowing the exact type of the denominator (0, 0.0, 0j) doesn't sound too useful as well -- unless you somehow manage to get the wrong type and a 0-value at the same time.

On a side note, I don't like
ZeroDivisionError: integer division or modulo of 3 by 0
too much, but I would prefer
ZeroDivisionError: integer division (or modulo) by zero
over
ZeroDivisionError: integer division or modulo by zero

IIRC the reason why both "division" and "modulo" are included in the message is because the error is created in a piece of code that is shared by both operations.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15815>
_______________________________________


More information about the Python-bugs-list mailing list