[New-bugs-announce] [issue7482] Improve ZeroDivisionError message for float and complex object

Ezio Melotti report at bugs.python.org
Fri Dec 11 23:17:28 CET 2009


New submission from Ezio Melotti <ezio.melotti at gmail.com>:

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 division

The attached patch adds "by zero" to the error messages of float and
complex in case of division, modulo or divmod by zero.

(Should I add tests to check the error message too?)

----------
assignee: ezio.melotti
components: Interpreter Core
files: issue7482.patch
keywords: needs review, patch, patch
messages: 96275
nosy: ezio.melotti, mark.dickinson
priority: normal
severity: normal
stage: patch review
status: open
title: Improve ZeroDivisionError message for float and complex object
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file15528/issue7482.patch

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


More information about the New-bugs-announce mailing list