Comment on PEP-0238

Aahz Maruch aahz at panix.com
Fri Jul 6 19:17:39 EDT 2001


In article <3dd77drkea.fsf at ute.cnri.reston.va.us>,
Andrew Kuchling  <akuchlin at mems-exchange.org> wrote:
>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.

I'm in agreement with Guido that at least two releases are necessary
(I also agree that it could be two warning releases).  But I think
Guido's step 3 (if used) should be changed to the semantically equivalent

    In Python 2.4, integer division with the '/' operator raises an
    exception.  This exception can be caught as usual, but the
    programmer should prepare for the next release of Python by either
    using the div() function or by using the future directive to get
    floating point division.

(Calling it an error is technically imprecise; an exception isn't
*necessarily* an error.)

>>   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.

Ditto.
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

So much Astroglide.  So little time.



More information about the Python-list mailing list