Future division patch available (PEP 238)

Guido van Rossum guido at python.org
Wed Jul 25 07:33:08 CEST 2001

Alan Miller <ajm at enteract.com> writes:

> Guido van Rossum (guido at digicool.com) wrote:
> >- after "from __future__ import division", / is changed to return a
> >  float result from int or long operands (and so is /=).
> So who's going to write slashnanny.py that will go through old code and 
> warn about existing operations that will be broken by the change?

I don't know yet, but it will definitely be made available in some
form, long before such code is actually broken.  One idea is a command
line switch that makes Python spit out a warning whenever an int
division has a nonzero remainder, but there are more sophisticated
ideas too, using type inference.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-list mailing list