from __past__ import integerDivision (was Re: A modest PEP0238 suggestion)

Stephen Horne steve at lurking.demon.co.uk
Fri Jul 27 04:55:54 EDT 2001


On Wed, 25 Jul 2001 05:06:51 GMT, Guido van Rossum <guido at python.org>
wrote:

>missive at frontiernet.net (Lee Harr) writes:
>
>> I think this is what the PEP is proposing:
>> 
>> // is current / behaviour
>> / is new int/int --> fp
>
>No, a//b would always return floor(a/b).
>
>> we already have people importing things from the __future__,
>> how difficult would it be to let people drag things from the __past__?
>
>But the problem (as I see it)
>is that there will never be a point where we can throw away support
>for the past behavior, because there will always be code around that
>imports it.

Of course there is.

You just give an explicit error when the import is disallowed
(out-of-range-of-time-machine or some such), and refuse to run the
script.

This is much better than code that runs incorrectly. It means people
know they have a problem, they have a very good clue as to what that
problem is, and they can try to find a solution - rather than
continuing to trust outputs from previously reliable programs or
libraries that have gone bad.




More information about the Python-list mailing list