Comment on PEP-0238

Andrew Kuchling akuchlin at mems-exchange.org
Fri Jul 6 14:18:37 EDT 2001


Guido van Rossum <guido at python.org> writes:
> 3. A revision later, we change all plain integer divisions to be an
>    error, *forcing* folks to use div() or use the future statement to
>    specify floating point division.

Step 3 strikes me as a bit odd; does that mean documentation for that
release will have to say "applying the / operator to integers is an
error, full stop"?  And then in the next release the docs will again
have to be changed to say that integer division now works?  IMHO step
3 should be dropped; one release with a warning every time integer
division is attempted should be sufficient.

>   from __future__ import float_division
>   from __future__ import real_division
>   from __future__ import new_division
>   from __future__ import division

'float_division'.  There's no type corresponding to "real", nor is
that terminology used anywhere in the docs; 'new_division' and
'division' strike me as unclear.

I still like 'x div 3' better than div() or //, but can live with div().

> Unfortunately, the number of potential Python programmers who will be
> frustrated by the current integer division is much larger than the
> number of established Python programmers.  

I'm still unconvinced about that, though.  Like the occasional claims
that there would be many more Python users if more conventional block
delimiters are used, this strikes me as proof by assertion.

--amk




More information about the Python-list mailing list