[issue7482] Improve ZeroDivisionError message for float and complex object

2009-12-21 Thread Retro
Retro added the comment: The patch is *almost* okay. errno = 0; div = c_quot(v->cval,w->cval); /* The raw divisor value. */ if (errno == EDOM) { - PyErr_SetString(PyExc_ZeroDivisionError, "complex remainder"); + PyErr_SetString(PyExc_ZeroDivisionError

[issue7482] Improve ZeroDivisionError message for float and complex object

2009-12-19 Thread Mark Dickinson
Mark Dickinson added the comment: No, I don't think you should add tests for the error messages; there should already be tests for the type of error, and that's enough. -- ___ Python tracker _

[issue7482] Improve ZeroDivisionError message for float and complex object

2009-12-19 Thread Mark Dickinson
Mark Dickinson added the comment: So if we're going to change the error messages, it would be nice if the new error messages were grammatical English. 'complex division by zero' is fine, but e.g. 'float modulo by zero' doesn't really make sense. Actually I'd be fine with 'float division by

[issue7482] Improve ZeroDivisionError message for float and complex object

2009-12-11 Thread Ezio Melotti
New submission from Ezio Melotti : The current error messages for divisions by 0 of float and complex object say "float/complex division", whereas for int and long is "integer/long division by zero": >>> 5/0 ZeroDivisionError: integer division or modulo by zero >>> 5.0/0 ZeroDivisionError: float