Future division patch available (PEP 238)

Ian Parker parker at gol.com
Mon Aug 13 16:39:16 CEST 2001


In article <MPG.15c7942e7652fd7b989800 at news-enteract>, 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?
>
>ajm

Apologies for my hopelessly late follow-up, but I've just checked the
code for one of my projects:

"19 .py files scanned totalling 6557 lines.  13 files contained '/'
(averaging 12.15 in each file)."

This was worse until I remembered (slapping my head) the
"#!/usr/local/bin/python" at the start of each file.  On the other hand,
I didn't attempt to exclude slashes embedded in strings.

Clearly there'll be an effective tool to identify likely areas of
concern, but I hope it won't generate too many false-positives (if
that's the correct way round) and zero of whatever the opposite is.

Regards

-- 
Ian Parker



More information about the Python-list mailing list