A use for integer quotients

Stephen Horne steve at lurking.demon.co.uk
Mon Jul 23 03:20:07 EDT 2001


On Mon, 23 Jul 2001 01:30:09 -0400, "Tim Peters" <tim.one at home.com>
wrote:

>> but that's a small unrepresentative  sample.  Note I'm less interested
>> in divisions of quantities that are already floats as those would be
>> unaffected by this proposal.
>
>Understood; see above; and a runtime warning pinpointing instances of "/"
>where this happens is easy enough to add.
>

Maybe that is what should be done for those doing numeric work who are
worried about the silent loss of precision...

from __warnings__ import paranoid_division

Could lead to a warning every time '/' is done with integers, so that
they could change it to the *new* '//' operator that always returns
floats ;-)

Why make the majority change their code when it only benefits the
minority?




More information about the Python-list mailing list