This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Incorrect ZeroDivisionError message with __future__ division
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: gerrit, rhettinger, tim.peters
Priority: normal Keywords:

Created on 2004-01-26 16:10 by gerrit, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg19832 - (view) Author: Gerrit Holl (gerrit) Date: 2004-01-26 16:10
>>> 1/0
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ZeroDivisionError: integer division or modulo by zero
>>> from __future__ import division
>>> 1/0
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ZeroDivisionError: float division

The latter is incorrect, or at least confusing, because
we aren't dividing floats, we're dividing integers.
msg19833 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-01-26 16:14
Logged In: YES 
user_id=31435

But with __future__ division, int/int *is* float division.  
int//int (two slashes) is integer division then.
msg19834 - (view) Author: Gerrit Holl (gerrit) Date: 2004-01-26 16:19
Logged In: YES 
user_id=13298

Hmm, OK, my misunderstanding then. It is indeed confusing ;-)
msg19835 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-02-21 08:43
Logged In: YES 
user_id=80475

This may be a matter of perspective.  The whole point of
true division is to treat integer division arguments as
floating point.
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39871
2004-01-26 16:10:48gerritcreate